Thursday, December 31, 2015

Unable to Reference classes in App_Code or other folder in Web Application Project


So if you google "unit testing on web application projects" you'll get discussion on using the "web application" project instead of "web site" project type. I won't retread that here, its been done elsewhere:
http://stackoverflow.com/questions/1198555/unit-testing-asp-net-web-site-project-code-stored-in-app-code?rq=1

Other common solutions to the problem are the .NET version.

But if that still doesn't work, it could be the content type on your files. This often happens when you have folders in your project (like App_Code) and add new items to those folders. Right click on those files in your solution explorer and select Properties.. --> change their type from "Content" to "Compile" and your reference should succeed:

Here is a link to more discussion and a post that had the answer I was looking for the whole time:
http://stackoverflow.com/questions/4228992/namespace-not-recognized-even-though-it-is-there

No comments:

Post a Comment