views:

176

answers:

1

I've a (C++) solution with a Tools project and a Main project. Main depends on Tools.

I can build this project easily using MSBuild with e.g.

msbuild /t:configuration="Release" Main.sln

The Tools project only have the "Release" and "Debug" configuration. The Main project also have a "Release Lite" configuration - from within Visual Studio I can use the Configuration Manager to have it build Tools using "Release" config and Main using "Release Lite" configuration.

How can I tell msbuild to build Tools using one configuration, and Main using another configuration ?

+2  A: 
  1. In Visual Studio, go to menu Build > Configuration Manager.
  2. In the Configuration Manager, create a new solution configuration by opening Active Solution Configurations dropdownlist and selecting New.... (make sure you untick the Create new project configurations checkbox)
  3. In this new solution configuration, select the configuration that you want to use for each project.
  4. Run msbuild msbuild /t:configuration="YourNewConfig" Main.
Arnold Zokas
@Anonym The /t:configuration switch is applied at solution level. You could also edit the solution "Release" configuration to use "Release Lite" configuration on the Main project. Follow step 1 above, but in step 2 choose the "Edit..." option
Arnold Zokas
Thanks - "Create new project configuration" checkbox got me the first time ...
Anonym