msbuild 15失败,缺少定位框架

时间:2017-09-06 18:48:05

标签: .net msbuild continuous-integration

我为visual studio 2017安装了构建工具(msbuild 15),我在构建解决方案时遇到了问题。我在安装构建工具之前安装了框架(4.6.1),因此它存在。

C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1122,5): error MSB3644: 
The reference assemblies for framework ".NETFramework,Version=v4.6.1" 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.

编辑:请注意,在这种情况下,我实际上是在尝试静默安装msbuild;所以我无法访问用户界面。

1 个答案:

答案 0 :(得分:3)

您可能已安装了框架,但未安装定位包/“开发人员包”。您可以检查版本是否作为C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework的子目录存在。

您可以通过运行Visual Studio安装程序来安装缺少的支持,单击VS 2017安装上的“修改”,然后从“单个组件”中选择要为其构建的.NET Framework版本的目标包和SDK。