Can I set the platform toolset from the command line when building with VS2010's msbuild?

后端 未结 4 412
生来不讨喜
生来不讨喜 2020-12-14 21:27

When I\'m building a VS2010 with msbuild from the command line, can I change the platform toolset to v90 (i.e. Visual Studio 2008 toolchain) from the command line, without e

4条回答
  •  不思量自难忘°
    2020-12-14 22:08

    Yes you can set PlatformToolset without change the vcxproj file.

    If you open a vcxproj file, you'll see that there is a PlatformToolset property. For visual studio 2012, it is v110; For VS2010, it is v100; For VS2008, it is v90.

    You could overwrite this property with /p:PlatformToolset=v110/v100/v90 to change the toolchain.

    Note: Sometimes, msbuild failed with error Unsupported platformtoolset value, it is mostly because you have not specify the VisualStudioVersion.

提交回复
热议问题