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

孤者浪人 提交于 2019-12-10 15:16:13

问题


I am refactoring a stack of ASP.NET pages. 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. How can I temporarily exclude them without removing them from the project itself? Can you do so through configuration of some sort?


回答1:


On Visual studio 2010 or later, you can achieve the functionality in two ways.

1)Right click the file, select 'Exclude From Project'

2)Right click the file, select 'Properties' --> select 'Configuration Properties' --> select 'General' --> choose 'Yes' from drop down menu for option 'Excluded From Build'




回答2:


Right-click on the file(s) and select "Exclude from project".




回答3:


I would create two projects and copy over the completed ones to the new project as they are refactored, then build the new project.



来源:https://stackoverflow.com/questions/219417/how-to-exclude-asp-net-web-site-code-behind-files-from-compile

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!