Building Visual Studio 2015 C++ project (v140) by MSBuild Failed - v140 cannot be found

前端 未结 2 456
遥遥无期
遥遥无期 2021-02-02 01:53

I have Visual Studio 2013 and 2015 installed side by side. I have just upgraded the combined solution (C#, C++, C++/CLI) to 2015 and set Platform Toolset to v140.

The bu

2条回答
  •  暖寄归人
    2021-02-02 02:08

    Your problem is that you set the environment variable VisualStudioVersion to 12.0. This tells MSBuild to use the Visual Studio 2013 (V120) tools, which don't support the Visual Studio 2015 (V140) build tools. If you unset this environment variable, or pass the /p:VisualStudioVersion=14.0 option to MSBuild your project, should build. (Or at least get past this error).

    You can find more information about the VisualStudioVersion variable in a MSDN blog entry titled Visual Studio project compatibility and VisualStudioVersion.

提交回复
热议问题