共用方式為


MSB4062診斷碼

本文說明MSB4062錯誤碼。

消息正文

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.

說明

當 MSBuild 在執行工作之前無法載入工作元件時,就會發出此錯誤。

當工作在未備妥的環境中執行時,可能會造成錯誤MSB4062。 例如,當工作元件以 32 位 x86 為目標,但在 64 位 MSBuild 環境中執行時。

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.

解決辦法

確保工作在 UsingTask 元素中表達對所需運行時間環境的相依性。

適用對象

MSBuild 的所有版本