Build fails because "Microsoft.Build.Utilities" could not be loaded
timothyp
Posts: 13 Bronze 1
After a clean install on a new computer a project that built without issues before
fails to build on this new system. The error message is:
Error The "SmartAssembly.MSBuild.Tasks.Build" task could not be loaded from the assembly
SmartAssembly.MSBuild.Tasks, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7f465a1c156d4d57. Could not load file or assembly 'Microsoft.Build.Utilities, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
The system cannot find the file specified. Confirm that the 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.
In the project configuration the build task looks like this:
<Target Name="SmartAssemblyBuild" Condition=" '$(RunSmartAssembly)' != '' ">
<SmartAssembly.MSBuild.Tasks.Build ProjectFile="..\Project.saproj" OverwriteAssembly="True" />
</Target>
<SmartAssembly.MSBuild.Tasks.Build ProjectFile="..\Project.saproj" OverwriteAssembly="True" />
</Target>
Tagged:
Best Answer
-
Russell D Posts: 1,324 Diamond 5My first question would be what has changed in the clean install?
Do you have, say the same versions of Visual Studio installed? The same versions of the .NET Framework or - given that its a new clean build, I'm going to assume you haven't reinstalled all the old versions of the framework.
The assembly Microsoft.Build.Utilities, Version=2.0.0.0 is not available in a build environment where the .NET Framework 3.5 has not been installed, for example.
Have you visited our Help Centre?
Answers
(but was removed when 2017 was released).
(same version as on the old machine as I always keep everything up to date).
The old system may have had 3.5 installed, so I will give that a try first.
Thank you!