You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error MSB4018 The "ILLink" task failed unexpectedly.
System.InvalidOperationException: DOTNET_HOST_PATH is not set
at ILLink.Tasks.ILLink.get_DotNetPath()
at ILLink.Tasks.ILLink.GenerateFullPathToTool()
at Microsoft.Build.Utilities.ToolTask.ComputePathToTool()
at Microsoft.Build.Utilities.ToolTask.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() System.Private.Xml C:\git\runtime3\eng\illink.targets 288
VS still uses the SDK targets (just on desktop MSBuild) when publishing. We still need the fix in runtime - I'm just talking about the "dotnet publish /p:PublishTrimmed" scenario. Desktop MSBuild or not, these targets locate a dotnet host, and start a new process that runs the linker on .NET Core.
Activity
Fix illink invocation inside VS
eerhardt commentedon Sep 24, 2020
FYI - @sbomer @vitek-karas
sbomer commentedon Sep 24, 2020
This shouldn't be a problem in the SDK, where we already look at
NetCoreRoot: https://github.com/dotnet/sdk/blob/master/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.ILLink.targets#L82. See also dotnet/linker#806.ViktorHofer commentedon Sep 24, 2020
This is about Desktop MSBuild inside VS. I don't think the SDK comes into play here?
sbomer commentedon Sep 24, 2020
VS still uses the SDK targets (just on desktop MSBuild) when publishing. We still need the fix in runtime - I'm just talking about the "dotnet publish /p:PublishTrimmed" scenario. Desktop MSBuild or not, these targets locate a dotnet host, and start a new process that runs the linker on .NET Core.
ViktorHofer commentedon Sep 24, 2020
Oh, just to clarify, this is broken in our custom invocation of the ILLinkTask in illink.targets: eng\illink.targets 288.
sbomer commentedon Sep 24, 2020
Right, I'm just trying to pre-empt concerns that it's similarly broken in the SDK. :)
ViktorHofer commentedon Sep 24, 2020
Ah cool, got it.
Fix illink invocation inside VS (#42678)