Visual Studio 2015-命令行重定向解决方案 [英] Visual Studio 2015 - command line retarget solution

查看:518
本文介绍了Visual Studio 2015-命令行重定向解决方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试使用Visual Studio 2015构建较旧的项目(VS2010)-从命令行开始.但是,我得到了:

Trying to build an older project (VS2010) with Visual Studio 2015 - from the command line. But, I'm getting this:

C:\ Program Files(x86)\ MSBuild \ Microsoft.Cpp \ v4.0 \ V140 \ Microsoft.Cpp.Platform.targets(55,5):错误MSB8020:Visual Studio 2010的生成工具(Platform Toolset ='v100')找不到.要使用v100生成工具进行生成,请安装Visual Studio 2010生成工具.或者,您可以通过选择项目"菜单或右键单击解决方案,然后选择重新定位解决方案",升级到当前的Visual Studio工具.

C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Platform.targets(55,5): error MSB8020: The build tools for Visual Studio 2010 (Platform Toolset = 'v100') cannot be found. To build using the v100 build tools, please install Visual Studio 2010 build tools. Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution".

有人知道如何从命令行重新定位解决方案"吗?

Anyone know how to "Retarget solution" from the command line?

推荐答案

C:\ Program Files(x86)\ MSBuild \ Microsoft.Cpp \ v4.0 \ V140 \ Microsoft.Cpp.Platform.targets(55,5):错误MSB8020:Visual Studio 2010的生成工具(Platform Toolset ='v100')找不到.

C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Platform.targets(55,5): error MSB8020: The build tools for Visual Studio 2010 (Platform Toolset = 'v100') cannot be found.

很显然,您没有安装Visual Studio 2010 (Platform Toolset = 'v100')工具集,而旧项目(Visual Studio 2010)引用了它.

Clearly, you don't have Visual Studio 2010 (Platform Toolset = 'v100') toolset installed and your old project (Visual Studio 2010) refers to it.

您的选项:

  1. 如果在Visual Studio 2015中打开vcxproj文件,则Go to project properties -> General settings.您将看到没有PlatformToolset属性.对于Visual Studio 2015,它是v140;对于Visual Studio 2010,它是v100.

  1. If you open a vcxproj file in Visual Studio 2015, Go to project properties -> General settings. you'll see that there is a PlatformToolset property. For Visual Studio 2015, it is v140; For Visual Studio 2010, it is v100.

将平台工具集更改为Visual Studio 2015 (Platform Toolset = 'v140').然后,您也许还可以从命令行和VS编辑器进行构建(请注意,升级解决方案并不能保证解决方案可以很好地构建.)

Change the Platform Toolset to Visual Studio 2015 (Platform Toolset = 'v140'). You may then be able to build from command line and from VS editor as well (beware, upgrading solution doesn't not guarantee that solution will build fine.)

您可以设置PlatformToolset而不更改vcxproj文件.您可以使用/p:PlatformToolset=v140覆盖PlatformToolset属性来更改工具集.

You can set PlatformToolset without changing vcxproj file. You could overwrite PlatformToolset property with /p:PlatformToolset=v140 to change the toolset.

例如msbuild myProject.vcxproj /p:PlatformToolset=v140

如果您不知道Platform Toolset及其值:

In case you don't know Platform Toolset and their values:

Visual Studio .NET 2002 (Platform Toolset = 'v70')
Visual Studio .NET 2003 (Platform Toolset = 'v71')
Visual Studio 2005      (Platform Toolset = 'v80')
Visual Studio 2008      (Platform Toolset = 'v90')
Visual Studio 2010      (Platform Toolset = 'v100')
Visual Studio 2012      (Platform Toolset = 'v110')
Visual Studio 2013      (Platform Toolset = 'v120')
Visual Studio 2015      (Platform Toolset = 'v140')
Visual Studio 2017      (Platform Toolset = 'v141')
Visual Studio 2019      (Platform Toolset = 'v142')
...

这篇关于Visual Studio 2015-命令行重定向解决方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆