Just for you to know I have created a project "ASP.NET MVC 4 Web Application" and then as project template I've chosen "Internet Application".
Now: as I wanted to add some of my helper classes and other utilities I created a "App_Code" folder.
I've tried to change namespace,changing from MyDemoProject.App_Code to just MyDemoProject. No success :)
So as App_Code classes were not available(accessible) I've searched a little around and I found this solution: you have to go at Properties section of the file and then for Build Action change from Content to Compile. That is it ;)
Of course, you have to bring in the namespace MyDemoProject or MyDemoProject.App_Code as it fits your scenario.
Hope it helped you, too.
Thanks! ran into the same issue today and couldn't figure out why mynamespaces inside App_Code weren't being recognized. This worked.
ReplyDeleteThanks a ton. You saved my time and this helped a lot. Thanks a lotttttt. otherwise i was of an impression that my concepts are probably not clear rnough to resolved this issue .
ReplyDeletevery useful article
ReplyDeleteOnline MVC Training
Very useful information
ReplyDeleteThanks a lot
ReplyDeleteIn visual studio 2012 I don't have the option to set build action..what should I do??
ReplyDelete