Open ramoneeza opened 5 years ago
I wonder if this is because in the .net core case, you should say msbuild.dll
instead of msbuild.exe
.
No. "msbuild.dll" doesn't work. Simply it returns allways null
When running in a .NET Core 2.1 context, what is the preferred way to get the ToolsPath for legacy csproj projects? Ref https://github.com/RSuter/DNT/issues/31
@cveld Building or loading legacy projects is not supported in .NET Core MSBuild.
Likewise, we don't anticipate supporting using a .NET Core version of ToolLocationHelper
to find full-framework MSBuild. https://github.com/Microsoft/MSBuildLocator can be used to find MSBuild in a Visual Studio installation, but only from a full-framework application.
Steps to reproduce
1) Create a new dotnet console app in Visual Studio 2) Add nuget package Microsoft.Build.Utilities.Core 3) Try to find where msbuild 15.x is located:
var path=ToolLocationHelper.GetPathToBuildToolsFile("msbuild.exe", buildversion);
Result is NULL under NetCore
3) Create a new .NET 4.7.1 console app in Visual Studio 4) Add nuget package Microsoft.Build.Utilities.Core 5) Repeat under .net frameword 4.7.1 the search again:
var path=ToolLocationHelper.GetPathToBuildToolsFile("msbuild.exe", buildversion);
Result is MSBUILD PATH under Visual Studio 2017 as expected.
Since ToolLocationHelper can be used via Nuget in both circunstances... I think there is a problem with dotnet, not been able to obtain msbuild location.