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?
To exclude specific files from deploymentIn the Solution Explorer window, right-click the file, and then click Properties. In the Properties window, in the Build Action row, select None.
Right-click the . aspx page, and then click View Code. The code-behind file opens in the editor.
By default, all the files in the project folder are published except for test cases. If you want to prevent a specific file from being included in the published package, right-click it in the Project panel, and then select Ignore from Publish (not available for workflow files in library projects).
We can right click on the file, choose properties, go to General and click on Excluded From Build, then choose Yes or No to exclude or re-include.
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'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With