msbuild icon indicating copy to clipboard operation
msbuild copied to clipboard

MSB4062 when a TaskHost task ships MSBuild assemblies

Open rainersigwald opened this issue 2 years ago • 0 comments

Reported internally over email in a thread titled Need help with investigation MSBuild Task load problem.

If a task ships MSBuild assemblies in its folder, the new MLC code can cause errors like

error MSB4062: The "SOMETHING" task could not be loaded from the assembly PATH. 
The assembly 'Microsoft.Build.Utilities.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' has already loaded been loaded into this MetadataLoadContext. 
Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. 

rainersigwald avatar Aug 29 '22 15:08 rainersigwald