How can I exclude a project from a build in MSBuild?

You can exclude projects at the solution level for a specific build configuration by using the Configuration Manager Dialog in Visual Studio:

Configuration Manager Dialog

Then you can simply invoke msbuild on the solution file specifying the build configuration to use:

msbuild /property:Configuration=Release MySolution.sln

Leave a Comment