namespace or class could not be found (ASP.NET WebSite "project")

Hi There – i had a similar problem; all my namespaces and inheritance was in place. Then i then noticed that the class file’s build action was set to “Content” not “Compile” (in the properties window.


For whatever worth might there be for an answer (possibly not the right one) after many months, i think i should contribute this:

There is a case that this happens, when you place a web site inside another (ie in a subfolder). In that case, the only App_Code folder that is legitimate is the App_code folder of the outer web site. That is, the App_Code folder right under the root of the master web site.

Maybe (say maybe) there should be no need to transform your web site to a web application, if you place the class file inside the App_code folder of the ROOT web site.

Tags:

C#

Asp.Net

C# 3.0