How can we help you today? How can we help you today?

Build fails because "Microsoft.Build.Utilities" could not be loaded

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>

timothyp
0

Comments

4 comments

  • Russell D
    My 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.
    Russell D
    0
  • timothyp
    The old install of Windows included Visual studio 2015 before
    (but was removed when 2017 was released).
    On the new system I just installed Visual Studio 2017
    (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.


    timothyp
    0
  • timothyp
    @Russell D Installing 3.5 through "add/remove windows components" solved my problem.
    Thank you!
    timothyp
    0
  • Russell D
    Great news :)
    Russell D
    0

Add comment

Please sign in to leave a comment.