Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable compilation of Visual Studio 2008 Project

Is there any way to tell visual studio to not include a project when building the solution without just removing the project from the solution?

The situation I have is that one project in a solution requires a plugin/tool/library that I don't have installed, but another developer on our team does. So when I try to build the solution, I get compilation errors. It's a unit testing project, so removing it from compilation wouldn't affect the function of the application.

I don't want to remove the project from the solution, because he would then just need to re-add it after I check in the solution (and then I would need to remove it when I check it out, ad infinitum).

like image 677
Eric Petroelje Avatar asked May 15 '09 15:05

Eric Petroelje


People also ask

How do I disable a project in Visual Studio?

To temporarily remove a project from the active solution configuration. On the menu bar, choose Build > Configuration Manager. In the Project contexts table, locate the project you want to exclude from the build.

Is rebuild the same as clean and build?

For a multi-project solution, "rebuild solution" does a "clean" followed by a "build" for each project (possibly in parallel). Whereas a "clean solution" followed by a "build solution" first cleans all projects (possibly in parallel) and then builds all projects (possibly in parallel).

What is the difference between build and rebuild in Visual Studio?

Build Solution - compiles code files (dll and exe) that have changed. Rebuild Solution - Deletes all compiled files and Compiles them again regardless of whether or not the code has changed.

What does clean solution do in Visual Studio?

Choose Clean Solution to delete any intermediate and output files. With only the project and component files left, new instances of the intermediate and output files can then be built.


4 Answers

Go to the "Build" dropdown, choose "Configuration Manager", and you can select which configuration you want to update. Then in the list of project below, deselect the "Build" checkmark on the project you want to exclude from the build.

like image 171
Casey Williams Avatar answered Oct 26 '22 02:10

Casey Williams


A quick fix is to unload the project. This is a local setting so it won't change the solution or the project.

like image 44
Marnix van Valen Avatar answered Oct 26 '22 02:10

Marnix van Valen


Right Click on Solution>Configuration Manager...

Here you can see a grid with a Build column with checkboxes, just uncheck the project you don't want to be build.

like image 28
jmservera Avatar answered Oct 26 '22 02:10

jmservera


if you unload the project, then other projects that have any reference to the project that you unload, will throw build error during compilation

like image 24
Murad Mohd Zain Avatar answered Oct 26 '22 00:10

Murad Mohd Zain