Larsenal
Larsenal

Reputation: 51176

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?

Upvotes: 6

Views: 3870

Answers (3)

notytony
notytony

Reputation: 1052

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'

Upvotes: 4

John Sheehan
John Sheehan

Reputation: 78132

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

Upvotes: 0

Chris Van Opstal
Chris Van Opstal

Reputation: 37567

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

Upvotes: 2

Related Questions