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

查看:107
本文介绍了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)MSBuildMicrosoft.Cppv4.0V140Microsoft.Cpp.Platform.targets(55,5): error MSB8020: The build tools for Visual Studio 2010 (Platform Toolset)= 'v100') 找不到.要使用 v100 构建工具进行构建,请安装 Visual Studio 2010 构建工具.或者,您可以通过选择项目"菜单或右键单击解决方案,然后选择重定向解决方案"来升级到当前的 Visual Studio 工具.

C:Program Files (x86)MSBuildMicrosoft.Cppv4.0V140Microsoft.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)MSBuildMicrosoft.Cppv4.0V140Microsoft.Cpp.Platform.targets(55,5): error MSB8020: The build tools for Visual Studio 2010 (Platform Toolset)= 'v100') 找不到.

C:Program Files (x86)MSBuildMicrosoft.Cppv4.0V140Microsoft.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 文件,转到项目属性 ->常规设置. 您会看到有一个 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(平台工具集 = '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.)

您可以在不更改 vcxproj 文件的情况下设置 PlatformToolset.您可以使用 /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

如果您不知道平台工具集及其值:

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天全站免登陆