Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 923
Larsenal Avatar asked Oct 20 '08 18:10

Larsenal


People also ask

How do you exclude files from a build?

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.

How can I see the code-behind ASPX?

Right-click the . aspx page, and then click View Code. The code-behind file opens in the editor.

How can we leave out a specific file from the publishing package?

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).

How do I get excluded files in Visual Studio?

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.


1 Answers

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'

like image 91
notytony Avatar answered Oct 22 '22 07:10

notytony