在GAC中找不到“ System.Xaml”

时间:2018-11-16 01:15:19

标签: c# visual-studio visual-studio-2017 nuget

尝试在我的SLN中使用Nuget更新Microsoft.Build.Framework,并出现以下错误。这是VS 2017 Enterprise版本15.9.1 在此Sln中投影所有目标NET461。

我在具有相同项目的2台不同Windows 10计算机上重复了此问题。

我该怎么做才能更新这些软件包?

输出

Attempting to gather dependency information for package 'Microsoft.Build.Framework.15.8.166' with respect to project 'Synovia.Service', targeting '.NETFramework,Version=v4.7.2'
Gathering dependency information took 3.08 sec
Attempting to resolve dependencies for package 'Microsoft.Build.Framework.15.8.166' with DependencyBehavior 'Lowest'
Resolving dependency information took 0 ms
Resolving actions to install package 'Microsoft.Build.Framework.15.8.166'
Resolved actions to install package 'Microsoft.Build.Framework.15.8.166'
Found package 'Microsoft.Build.Framework 15.8.166' in 'D:\git\sbss\Source\packages'.
  GET https://api.nuget.org/v3-flatcontainer/microsoft.build.tasks.core/15.7.179/microsoft.build.tasks.core.15.7.179.nupkg
  GET https://api.nuget.org/v3-flatcontainer/microsoft.build.utilities.core/15.7.179/microsoft.build.utilities.core.15.7.179.nupkg
Retrieving package 'Microsoft.Build.Tasks.Core 15.7.179' from 'nuget.org'.
Retrieving package 'Microsoft.Build.Utilities.Core 15.7.179' from 'nuget.org'.
Found package 'Microsoft.VisualStudio.Setup.Configuration.Interop 1.16.30' in 'D:\git\sbss\Source\packages'.
Removed package 'Microsoft.Build.Framework.15.6.82' from 'packages.config'
  OK https://api.nuget.org/v3-flatcontainer/microsoft.build.utilities.core/15.7.179/microsoft.build.utilities.core.15.7.179.nupkg 53ms
Installing Microsoft.Build.Utilities.Core 15.7.179.
  OK https://api.nuget.org/v3-flatcontainer/microsoft.build.tasks.core/15.7.179/microsoft.build.tasks.core.15.7.179.nupkg 78ms
Successfully uninstalled 'Microsoft.Build.Framework.15.6.82' from Synovia.Service
Installing Microsoft.Build.Tasks.Core 15.7.179.
Removed package 'Microsoft.Build.Tasks.Core.15.6.82' from 'packages.config'
Successfully uninstalled 'Microsoft.Build.Tasks.Core.15.6.82' from Synovia.Service
Removed package 'Microsoft.Build.Utilities.Core.15.6.82' from 'packages.config'
Successfully uninstalled 'Microsoft.Build.Utilities.Core.15.6.82' from Synovia.Service
Package 'Microsoft.Build.Framework.15.8.166' already exists in folder 'D:\git\sbss\Source\packages'
Install failed. Rolling back...
Package 'Microsoft.Build.Framework.15.8.166' does not exist in project 'Synovia.Service'
Package 'Microsoft.Build.Utilities.Core.15.6.82' already exists in folder 'D:\git\sbss\Source\packages'
Added package 'Microsoft.Build.Utilities.Core.15.6.82' to 'packages.config'
Package 'Microsoft.Build.Tasks.Core.15.6.82' already exists in folder 'D:\git\sbss\Source\packages'
Added package 'Microsoft.Build.Tasks.Core.15.6.82' to 'packages.config'
Package 'Microsoft.Build.Framework.15.6.82' already exists in folder 'D:\git\sbss\Source\packages'
Added package 'Microsoft.Build.Framework.15.6.82' to 'packages.config'
Executing nuget actions took 6.84 sec
Failed to add reference. The package 'Microsoft.Build.Framework' tried to add a framework reference to 'System.Xaml' which was not found in the GAC. This is possibly a bug in the package. Please contact the package owners for assistance.
  Reference unavailable.
Time Elapsed: 00:00:10.1224742
========== Finished ==========

1 个答案:

答案 0 :(得分:0)

  

在GAC中找不到的“ System.Xaml”

您的项目可能是目标.Net 3.5,它没有此DLL。您可以在项目属性中更新框架版本。

如果上述方法不能解决您的问题,或者您不想更改框架版本,则可以将引用System.Xaml手动添加到您的项目中:

转到参考-> 添加参考... ,然后单击浏览。。

添加文件,该文件位于(Windows 10):C:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Xaml\v4.0_4.0.0.0__b77a5c561934e089\System.Xaml.dll

然后更新您的nuget程序包。

希望这会有所帮助。