I have a Code folder in my asp.net mvc web project, I added a .cs file and the compiler does not seem to pick up any errors I make. However, if I first add the .cs file to the root of my mvc web project and then moves it to the Code folder, the compiler will work properly. Why is this happening? I’m using VS10 and mvc3. Thanks.
Edit: I notice I first called the folder App_Code and then renamed it to Code, so it seems if you add .cs to App_Code the compiler doesn’t run on those, even if you move the .cs out or change the folder name to something else. Very strange.
From what you describing it sounds like the
Build Actionis not set toCompileon your file.In response to your Edit. The
App_Codeis a special folder in ASP.NET, its files are compiled at run time. For more information see: Shared Code Folders in ASP.NET Web Sites