ASP.NET Web应用程序 - 编译的.cs文件 [英] ASP.NET Web Application - compiling .cs files

查看:82
本文介绍了ASP.NET Web应用程序 - 编译的.cs文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想我一直在使用本网站的模型自从.NET 2.0,并且永不回头。
现在,我使用的几个项目的Web应用程序模式。你如何告诉编译器编译的.cs文件中的项目?我相信你能做到这一点,因为较新的MVC的项目做的控制器。

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.

我有一个类,RestRouteHandler,实现IRouteHandler接口,但因为我觉得cs文件不被编译,我不能在我的Global.asax中使用它。

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.

推荐答案

右键单击Solution Explorer中的cs文件,然后单击属性。设置构建行动进行编译。

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

这篇关于ASP.NET Web应用程序 - 编译的.cs文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆