Delen via


MSB4062 diagnostische code

In dit artikel wordt de MSB4062 foutcode beschreven.

Tekst van het bericht

MSB4062: The 'value' task could not be loaded from the assembly 'value'. 'value' 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.

Beschrijving

Deze fout wordt gegenereerd wanneer MSBuild een taakassembly niet kan laden voordat de taak wordt uitgevoerd.

Fout MSB4062 kan worden veroorzaakt wanneer een taak wordt uitgevoerd in een omgeving waarvoor deze niet is voorbereid. Wanneer een taakassembly bijvoorbeeld is gericht op 32-bits x86, maar deze wordt uitgevoerd in een 64-bits MSBuild-omgeving.

S:\BitnessInMSBuild\ShowErrors.proj(13,5): error MSB4062: The "TaskCompiledForx86" task could not be loaded from the assembly S:\BitnessInMSBuild\TaskCompiledForx86\bin\Debug\net472\TaskCompiledForx86.dll. Could not load file or assembly 'file:///S:\BitnessInMSBuild\TaskCompiledForx86\bin\Debug\net472\TaskCompiledForx86.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format. 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.

Resolutie

Zorg ervoor dat de taak een afhankelijkheid uitdrukt van de runtime-omgeving die nodig is in het UsingTask-element van de taak.

Van toepassing op

Alle versies van MSBuild