Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

visual c++ - How to use MSBuild to target v110 platform toolset?

I am developing a command line application that creates a full Visual Studio 11 solution made of a single VC++ project and that tries to compile it in the end using MSBuild.

The problem I am facing is strange.

If I execute my command line program inside Visual Studio 11 it works; if I instead launch it outside the development environment it throws me the error:

C:Program Files (x86)MSBuildMicrosoft.Cppv4.0PlatformsWin32Microsoft.Cpp.Win32.Targets(511,5): error MSB8008: Specified platform toolset (v110) is not installed or invalid. Please make sure that a supported PlatformToolset value is selected. [f:ABC.vcxproj]

The command I am using is the following:

C:WindowsMicrosoft.NETFrameworkv4.0.30319msbuild.exe f:snakeW9A30040.vcxproj /property:PlatformToolset=v110;Configuration=Debug /v:quiet

But I have the feeling that PlatformToolset=v110 is ignored and MSBuild use v100 (Visual Studio 2010).

Do you have any suggestions how to tell MSBuild to compile for v110 Platform Toolset?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I ran into the same problem as well with the full release of VS 2012. You can also set the VisualStudioVersion as a property with MSBuild as opposed to dealing with environment variables as mentioned in the accepted answer. For instance:

C:WindowsMicrosoft.NETFrameworkv4.0.30319MSBuild.exe .myproject.vcxproj /p:VisualStudioVersion=11.0

The environment variables approach I'm sure work just as well, I honestly didn't try that as I was trying to stay away from having to modify the environment variables.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...