开发者

MSBuild, build dependent projects with different configurations

开发者 https://www.devze.com 2022-12-20 19:42 出处:网络
I\'ve a (C++) solution with a project, Tools, and another project, Main. Main depends on Tools. I can build this project easily using MSBuild, with for example,

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

I can build this project easily using MSBuild, with for example,

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 conf开发者_StackOverflow中文版iguration?


  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.
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号