Visual Studio 2022 仍在寻找 v142 平台工具集。

huangapple go评论61阅读模式
英文:

Visual Studio 2022 still looking for v142 platform toolset

问题

我最近将Visual Studio 2019替换为Visual Studio 2022,因为我的团队最近引入了对它的支持。

但是,我在使用Visual Studio 2022构建以下项目规范时遇到了一个奇怪的错误:
Visual Studio 2022 仍在寻找 v142 平台工具集。
错误:

MSB8020:无法找到Visual Studio 2019的构建工具(Platform Toolset = 'v142')。
要使用v142构建工具进行构建,请安装Visual Studio 2019构建工具。
或者,您可以通过选择项目菜单或右键单击解决方案,然后选择“重新定位解决方案”来升级到当前的Visual Studio工具。

我已经尝试了多次重新定位项目,奇怪的是,使用“Debug”配置(工具集方面似乎是相同的)项目就能正常构建:
Visual Studio 2022 仍在寻找 v142 平台工具集。

我是否可能遗漏了其他设置,以完全将我的项目迁移到143平台工具集?

谢谢

英文:

I've recently replaced Visual Studio 2019 with Visual Studio 2022 as my team recantly introduced support for it.

I'm now facing a strange error when building the following project specification with Visual Studio 2022:
Visual Studio 2022 仍在寻找 v142 平台工具集。
Error:

MSB8020	The build tools for Visual Studio 2019 (Platform Toolset = 'v142') cannot be found.
To build using the v142 build tools, please install Visual Studio 2019 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".

I've tried to retarget the project several times, the strage think is that with the "Debug" configuration (apparently idantical regarding toolset) the project just builds fine:
Visual Studio 2022 仍在寻找 v142 平台工具集。

Is there any other setting I may be missing in order to completely port my project to the 143 platform toolset?

Thanks

答案1

得分: 0

我建议在文本编辑器中打开项目文件,搜索以下内容:

<PlatformToolset>v142</PlatformToolset>

然后将其替换为:

<PlatformToolset>v143</PlatformToolset>

您还可以将以下内容:

<VCToolsVersion>"some specific version number"</VCToolsVersion>

替换为:

<VCToolsVersion></VCToolsVersion>
英文:

I would recommend to open the project file in a text editor, search for occurences of

 <PlatformToolset>v142</PlatformToolset>

and replace them by v143 (or use the information where you found it to identify the configuration which causes the issue). You may also replace

 <VCToolsVersion>"some specific version number"</VCToolsVersion>

by

 <VCToolsVersion></VCToolsVersion>

答案2

得分: 0

终于我能够理解问题出在哪里了。
这些项目已经以手动方式更新到v143,使用文本编辑器进行操作:主项目引用其他项目,但引用并没有更新,因此在构建主项目时,Visual Studio 仍然尝试构建为 Visual Studio 2019 设计的旧项目。
一旦我将引用更新为适用于 Visual Studio 2022 的新项目,一切都构建正常。

英文:

Finally I've been able to understand what was wrong.
The projects were updated to v143 in a manual way using a text editor: the main project references other projects and the references were not updated so when building the main project Visual Studio still tried to build the old project designed for Visual Studio 2019.
Once I've updated the references to the new projects for Visual Studio 2022 everything builds fine.

huangapple
  • 本文由 发表于 2023年6月12日 21:06:26
  • 转载请务必保留本文链接:https://go.coder-hub.com/76456974.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定