This project is read-only.

Choosing which projects to build

Jan 15, 2009 at 5:40 PM
Is there a way to tell msbuild not to build a certain project in a solution, depending on the build configuration?
So, if I have a solution with, say, project A, B and C, if I build it in debug configuration, all the projects should be built.
And if I build it in Release configuration, only A and B should be built.

Is it at all possible? Perhaps there is a target that does that?
Jan 16, 2009 at 1:00 PM
The easiest way would be configure what you want built for each configuration using Visual Studio  IDE (right click the solution and edit the Configuration). When you are happy with that, you need to tell MSBuild which configuration to build. This is done by passing in the Configuration property, e.g.

msbuild.exe yoursolution.sln /p:Configuration=Release
msbuild.exe yoursolution.sln /p:Configuration=Debug

Hope that helps.

Jan 18, 2009 at 9:23 AM
Mike, thank you for your help, and yes, it does help :)