我在TFS 2013服务器上安装了框架4.7.2,并尝试使用msbuild构建作业。
我收到以下错误:
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=
关于可以使FW 4.7.2与MsBuild配合使用的所有想法
最佳答案
尽管我们使用Azure Devops而不是TFS,但我们只是遇到了一个非常相似的问题(但我认为构建过程应该足够相似,至少就此而言)。
我通过在构建服务器上更新.NET Framework以及安装.NET Framework 4.7.2开发人员包来解决此问题,您可以从此处获取:
https://www.microsoft.com/net/download/visual-studio-sdks
不要忘记重启(就像我一样)。完成后,按照Leo的建议,尝试直接在生成服务器上的Visual Studio中打开项目,或者从命令行手动运行msbuild。
关于tfs - 针对框架4.7.2的TFS生成作业失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51826945/