TFS build job failed for Framework 4.7.2

ⅰ亾dé卋堺 提交于 2020-05-12 11:13:23

问题


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


回答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.




回答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.



来源:https://stackoverflow.com/questions/51826945/tfs-build-job-failed-for-framework-4-7-2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!