每次安装最后的VisualStudiosetup时,我最终都会下载MSBUILD 15.0而不是16或17

发布于 2025-02-10 23:52:34 字数 1435 浏览 2 评论 0原文

1-为什么我要问这个问题

我实际上是在尝试运行 npm install ,但我遇到以下错误:

npm install error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct

我遵循以下堆栈答案中建议的内容

C:\Program Files\Microsoft Visual Studio\2022\Community\Msbuild\Microsoft\VC\v170\Microsoft.Cpp.props(41,5): error MSB4186: Invalid static method invocation syntax: "[Microsoft.Build.Utilities.ToolLocationHelper]::FindRootFolderWhereAllFilesExist($(_VCTargetsPathFolders), $(_RelativeToolsetFiles))". Method 'Microso
ft.Build.Utilities.ToolLocationHelper.FindRootFolderWhereAllFilesExist' not found. Static method invocation should be of the form: $([FullTypeName]::Method()), e.g. $([System.IO.Path]::Combine(`a`, `b`)).  [C:\Users\hdaher\workspace\ahp-administration-portal-dashboard\node_modules\deasync\build\deasync.vcxproj]

href =“ https://stackoverflow.com/a/71892288/2721822”> Microsoft.cpp.default.props.cpp.default.props” 确实

> 尝试安装最新的Microsoft Visual Studio,我最终安装了 msbuild 15 。 我如何安装Visual Studio 2022版本17.2也使用MSBUILD 16或17进行发布。

我还尝试遵循我如何安装较新的MSBUILD版本?,仍然将MSBUILD卡在版本15上。

1- Why I am Asking The question

I am actually trying to run npm install but I am getting the following error:

npm install error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct

I followed what was suggested in the following stack answer Microsoft.Cpp.Default.props" was not found. The error disapeared indeed, but in return I got a new error.

C:\Program Files\Microsoft Visual Studio\2022\Community\Msbuild\Microsoft\VC\v170\Microsoft.Cpp.props(41,5): error MSB4186: Invalid static method invocation syntax: "[Microsoft.Build.Utilities.ToolLocationHelper]::FindRootFolderWhereAllFilesExist($(_VCTargetsPathFolders), $(_RelativeToolsetFiles))". Method 'Microso
ft.Build.Utilities.ToolLocationHelper.FindRootFolderWhereAllFilesExist' not found. Static method invocation should be of the form: $([FullTypeName]::Method()), e.g. $([System.IO.Path]::Combine(`a`, `b`)).  [C:\Users\hdaher\workspace\ahp-administration-portal-dashboard\node_modules\deasync\build\deasync.vcxproj]

Based on FindRootFolderWhereAll. FindRootFolderWhereAll exists in MSBuild 16,17 and not in MSBuild 15

2- Question

Every time I try to install the latest Microsoft Visual Studio, I end up install MsBuild 15.
How can I install Visual Studio 2022 version 17.2 Release with also Msbuild 16 or 17.

I also tried to follow what was suggested in How can I install a newer MSBuild version? and still Msbuild is stuck at version 15.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

↙温凉少女 2025-02-17 23:52:34

我们可以从官方文档 MSBUILD 17.0用Visual Studio 2022和.NET 6.0运送。
由于新版本号,我们还可以看到以下MSBUILD属性已更新。

  1. 此版本的工具的msbuildtoolsversion仍然是“当前”。组装版本与Visual Studio 2017和Visual Studio 2019中的版本相同,为15.1.0.0。
  2. 此版本的工具的Visual -Studioversion是“ 17.0”,

您可以在工具&GT下使用开发人员命令提示中的命令“ msbuild -ver”检查该版本;这样的命令行。

您可以从

We can see from the offical documents that MSBuild 17.0 shipped with Visual Studio 2022 and .NET 6.0.
We can also see the following MSBuild properties have been updated due to the new version number.

  1. MSBuildToolsVersion for this version of the tools remains "Current". The assembly version is the same as in Visual Studio 2017 and Visual Studio 2019, which is 15.1.0.0.
  2. VisualStudioVersion for this version of the tools is "17.0"

You can check the version by use the command “msbuild -ver” in Developer Command Prompt under Tools > Command Line like this.
enter image description here
You can download Visual Studio 2022 from here. If you have any questions please let me know and I will reply promptly.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文