EgorBo / Disasmo

VS2022 Add-in. Click on any method or class to see what .NET Core's JIT generates for them (ASM).
MIT License
638 stars 39 forks source link

MSBuild fails because `VCTargetsPath` is not set #57

Open sfiruch opened 3 months ago

sfiruch commented 3 months ago

I cannot use Disasmo in my solution, because of build failures in a referenced VC++ project:

MSBuild version 17.9.8+b34f75857 for .NET
  Determining projects to restore...
  Restored C:\Users\de\Source\my-awesome-project\CTP1bLibrary\CTP1bLibrary.csproj (in 373 ms).
  Restored C:\Users\de\Source\my-awesome-project\Scanner2Mat\Scanner2Mat.csproj (in 373 ms).
  3 of 5 projects are up-to-date for restore.
C:\Users\de\Source\my-awesome-project\MatIRILib\MatIRILib.vcxproj(20,3): error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the expression in the Import declaration "\Microsoft.Cpp.Default.props" is correct, and that the file exists on disk.

Apparently MSBuild is looking for Microsoft.Cpp.Default.props in the wrong directory. The import in the project file is <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />. It appears that VCTargetsPath is not set correctly when Disasmo tries to build my solution.

Repro

  1. Create a C# 8 project
  2. Add a reference to a VC++ project.