问题
I guess I have been using the Web Site model ever since .NET 2.0 and never looked back. Now I'm using the Web Application mode on a few projects. How do you tell the compiler to compile .cs files in the project? I assume you can do this since the newer-MVC projects do it for the Controllers.
I have a class, RestRouteHandler, that implements the IRouteHandler interface but because I think the .cs file is not being compiled I can't use it in my Global.asax.
回答1:
Right-click the .cs file in the Solution Explorer and click Properties. Set the "Build Action" to compile.
回答2:
use the "Build" menu in Visual Studio
来源:https://stackoverflow.com/questions/508689/asp-net-web-application-compiling-cs-files