TFS build job failed for Framework 4.7.2

18,551

Solution 1

We just had a very similar issue, although we use Azure Devops rather than TFS (but I think the build process should be similar enough, at least regarding this).

I resolved it by updating .NET framework on the build server as well as installing the .NET Framework 4.7.2 developer pack, which you can get from here: https://www.microsoft.com/net/download/visual-studio-sdks

Don't forget to reboot (like I did). Once that's done, as Leo suggested try opening the project in Visual Studio directly on your build server or manually running msbuild from the command line.

Solution 2

In some cases, the build definition may look fine at first glance. My Build > Tasks > Pipeline may have the correct Agent pool selected.

However, the Agent job, may have a completely different Agent pool selected.

In this case, just select the proper Agent pool and Save & queue a new build to resolve the issue.

Share:
18,551
Daniel
Author by

Daniel

Updated on June 03, 2022

Comments

  • Daniel
    Daniel almost 2 years

    I have installed framework 4.7.2 on TFS 2013 server and trying to build a job using msbuild.

    I am getting following error:

    Task Parameter:TargetFrameworkMoniker=.NETFramework,Version=v4.7.2 (TaskId:6) C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1098,5): error MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.7.2" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend. Output Property: _TargetFrameworkDirectories=

    Any ideas on what I can check to make the FW 4.7.2 to work with MsBuild

  • Daniel
    Daniel over 5 years
    ty, I didn't have visual studio installed, I am trying to copy it over and install. Once its installed, will let know
  • Daniel
    Daniel over 5 years
    C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targe‌​ts (1098): The reference assemblies for framework ".NETFramework,Version=v4.7.2" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend.
  • Daniel
    Daniel over 5 years
    After installing the 4.7.2 and rebooting the server, I am getting above error
  • Daniel
    Daniel over 5 years
    On another controller, I installed VS2017, I could not find the Msbuild in \15.0 directory. I only saw FileTracker folder in there. How can I get the MsBuild.exe in the 15 directory
  • Matt Wanchap
    Matt Wanchap over 5 years
    You're sure you installed the developer pack as well, and not just the framework itself?