ASP.NET Web Application - compiling .cs files

2019-07-31 14:16发布

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.

2条回答
我只想做你的唯一
2楼-- · 2019-07-31 14:26

use the "Build" menu in Visual Studio

查看更多
迷人小祖宗
3楼-- · 2019-07-31 14:38

Right-click the .cs file in the Solution Explorer and click Properties. Set the "Build Action" to compile.

查看更多
登录 后发表回答