TFS build job failed for Framework 4.7.2

Nate picture Nate · Aug 13, 2018 · Viewed 15.8k times · Source

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

Answer

Matt Wanchap picture Matt Wanchap · Aug 15, 2018

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.