You've checked your namespaces and references a hundred times but you're still getting this annoying error when accessing code files in a sub-folder?

Are you Missing an Assembly Reference?


There is more than one cause of this error, for example, you will sometimes see it when attempting to use the App_Code folder within an ASP.NET 2.0 Web Application project.

On this particular occassion, we are building an ASP.NET 2.0 Web Application project in C# using VS 2005. The folder containing the code file is just a regular folder, but the same error message appears.

Here's a fix that might work for you. Right-click the file you are trying to access in Solution Explorer.

File Properties in Solution Explorer


Select Properties which will open the Properties window. Go to the Build Action DropDown menu.

File Build Action


Select 'Compile' for the build action. In this case, it had been to be set to 'Content'. Now compile as normal and you should be able to reference the file.


Comments (1) -

Asmor United States
6/7/2010 11:58:19 AM #

Thank you so much! I've been having issues with a class in the app_code folder for weeks, and this solved it!