简体   繁体   English

如何从编译中排除ASP.NET网站代码隐藏文件?

[英]How to exclude ASP.NET web site code-behind files from compile?

I am refactoring a stack of ASP.NET pages. 我正在重构一堆ASP.NET页面。 I'd like to compile and test the ones I've completed. 我想编译和测试我已经完成的那些。 However, Visual Studio won't let me run the Web Site with compile errors on the non-refactored pages. 但是,Visual Studio不会让我在未重构的页面上运行带有编译错误的Web站点。 How can I temporarily exclude them without removing them from the project itself? 如何在不将其从项目本身中删除的情况下暂时排除它们? Can you do so through configuration of some sort? 你可以通过某种配置来实现吗?

On Visual studio 2010 or later, you can achieve the functionality in two ways. 在Visual Studio 2010或更高版本中,您可以通过两种方式实现该功能。

1)Right click the file, select ' Exclude From Project ' 1)右键单击该文件,选择“ 从项目中排除

2)Right click the file, select ' Properties ' --> select ' Configuration Properties ' --> select ' General ' --> choose ' Yes ' from drop down menu for option ' Excluded From Build ' 2)右键单击文件,选择“ 属性 ” - >选择“ 配置属性 ” - >选择“ 常规 ” - >从下拉菜单中选择“ ”以选择“ 从构建中排除

右键单击文件,然后选择“从项目中排除”。

我将创建两个项目,并将已完成的项目复制到新项目中,然后重构,然后构建新项目。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM