0

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.

Hani Gotc
  • 840
  • 11
  • 24

1 Answers1

0

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.

Jingmiao Xu-MSFT
  • 2,076
  • 1
  • 3
  • 10