cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Windows Hosting - CS0246 error

Hello everyone,

 

I am stuck on error CS0246: The type or namespace name 'Test' could not be found (are you missing a using directive or an assembly reference?)

 

 

The solution I find was to delete files from 
c:\windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\ca51cc6d\84cbc711\App_Web_index

Please can someone help how to delete files from Temporary ASP.NET file

3 REPLIES 3
Community Manager
Community Manager

Re: Windows Hosting - CS0246 error

Hi, @meerwaice. Welcome to GoDaddy Community! I'm not sure what this issue is, but it appears to be related to C# programming. I did find this Microsoft article that may be of assistance, though. Hope it helps. 

 

JesseW - GoDaddy | Community Manager | 24/7 support available at x.co/247support | Remember to choose a solution and give kudos.

Re: Windows Hosting - CS0246 error

The CS0246 is not a unique issue.  I have code running fine on my dev box, and get the same error when I moved to Go Daddy.  One fellow made cryptic changes to his web.config file, I tried them in hope, then got a 500 server error.  If any of the errors mentioned in the MS article were in my code, they should disallow it from working on my dev box (I suggest).  So I am wondering what is up with other files I do not see on Go Daddy - like the machine.config file.  Not being able to use Namespaces for support classes in C# is a hassle - the next step would be to compile my support classes as assemblies, and drop them in the cgi-bin directory.

Re: Windows Hosting - CS0246 error

Turns out my old code for a web site using Namespaces for "code includes" was not a robust approach ... and apparently no longer works with VS 2017.  So I switched to using a Master page approach, which allows sensible code sharing via the master page code-behind file. See https://docs.microsoft.com/en-us/aspnet/web-forms/overview/older-versions-getting-started/master-pag...   You can reference code methods in the Site Master .cs file directly with <Master Page Class>.<method> for static, else create an instance of the Master page.  The code is run locally as if it resides there - a truly awesome feature!