CodersBarn.com
The ASP.NET Community Blog

Are you Missing an Assembly Reference?

June 12, 2008 18:44 by agrace

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.

kick it on DotNetKicks.com   PHP, ASP, .NET, JSP Resources, Reviews


Tags: ,
Categories: Visual Studio
Actions: E-mail | Permalink | Comments (2) | Comment RSSRSS comment feed

Comments

June 7. 2010 11:58

Asmor

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

Asmor

July 31. 2010 01:50

abercrombie

Site very exciting. Congratulations!

abercrombie

Add comment




  Country flag

biuquote
  • Comment
  • Preview
Loading