MSB4062: Tugas tidak dapat dimuat dari rakitan
Kesalahan ini dipancarkan saat rakitan tugas tidak dapat dimuat sebelum menjalankan tugas.
Kesalahan MSB4018 dapat terjadi saat menjalankan tugas di lingkungan yang tidak disiapkan, misalnya saat perakitan tugas menargetkan 32-bit x86 tetapi berjalan di lingkungan MSBuild 64-bit.
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.
Untuk mengatasinya, pastikan bahwa tugas mengekspresikan dependensi pada lingkungan runtime yang diperlukan dalam elemen UsingTask milik tugas.