You can exclude projects at the solution level for a specific build configuration by using the Configuration Manager Dialog in Visual Studio:
Then you can simply invoke msbuild
on the solution file specifying the build configuration to use:
msbuild /property:Configuration=Release MySolution.sln