nuget为什么要安装一堆系统名称空间引用?

时间:2018-07-11 13:13:50

标签: c# visual-studio nuget

我正在尝试从nuget安装一个库。我原本期望3或4个不同的依赖项,但是它安装了System个依赖项的整个负载?

这是日志:

Attempting to gather dependency information for package 'TwitchLib.Client.2.1.4' with respect to project 'Twitch Logs', targeting '.NETFramework,Version=v4.6'
Attempting to resolve dependencies for package 'TwitchLib.Client.2.1.4' with DependencyBehavior 'Lowest'
Resolving actions to install package 'TwitchLib.Client.2.1.4'
Resolved actions to install package 'TwitchLib.Client.2.1.4'
Adding package 'Serilog.2.3.0' to folder '\\jgdc01\Users\RyanPearce\Documents\Visual Studio 2015\Projects\Twitch Logs\packages'
Added package 'Serilog.2.3.0' to folder '\\jgdc01\Users\RyanPearce\Documents\Visual Studio 2015\Projects\Twitch Logs\packages'
Added package 'Serilog.2.3.0' to 'packages.config'
Successfully installed 'Serilog 2.3.0' to Twitch Logs
Adding package 'System.Collections.4.0.11' to folder '\\jgdc01\Users\RyanPearce\Documents\Visual Studio 2015\Projects\Twitch Logs\packages'
Added package 'System.Collections.4.0.11' to folder '\\jgdc01\Users\RyanPearce\Documents\Visual Studio 2015\Projects\Twitch Logs\packages'
Added package 'System.Collections.4.0.11' to 'packages.config'
Successfully installed 'System.Collections 4.0.11' to Twitch Logs
Adding package 'System.Collections.Concurrent.4.0.12' to folder '\\jgdc01\Users\RyanPearce\Documents\Visual Studio 2015\Projects\Twitch Logs\packages'
Added package 'System.Collections.Concurrent.4.0.12' to folder '\\jgdc01\Users\RyanPearce\Documents\Visual Studio 2015\Projects\Twitch Logs\packages'
Added package 'System.Collections.Concurrent.4.0.12' to 'packages.config'
Successfully installed 'System.Collections.Concurrent 4.0.12' to Twitch Logs
Adding package 'System.Collections.Specialized.4.3.0' to folder '\\jgdc01\Users\RyanPearce\Documents\Visual Studio 2015\Projects\Twitch Logs\packages'
Added package 'System.Collections.Specialized.4.3.0' to folder '\\jgdc01\Users\RyanPearce\Documents\Visual Studio 2015\Projects\Twitch Logs\packages'
Added package 'System.Collections.Specialized.4.3.0' to 'packages.config'
Successfully installed 'System.Collections.Specialized 4.3.0' to Twitch Logs
Adding package 'System.Diagnostics.Debug.4.0.11' to folder '\\jgdc01\Users\RyanPearce\Documents\Visual Studio 2015\Projects\Twitch Logs\packages'
Added package 'System.Diagnostics.Debug.4.0.11' to folder '\\jgdc01\Users\RyanPearce\Documents\Visual Studio 2015\Projects\Twitch Logs\packages'
Added package 'System.Diagnostics.Debug.4.0.11' to 'packages.config'
Successfully installed 'System.Diagnostics.Debug 4.0.11' to Twitch Logs
Adding package 'System.Globalization.4.0.11' to folder '\\jgdc01\Users\RyanPearce\Documents\Visual Studio 2015\Projects\Twitch Logs\packages'
Added package 'System.Globalization.4.0.11' to folder '\\jgdc01\Users\RyanPearce\Documents\Visual Studio 2015\Projects\Twitch Logs\packages'
Added package 'System.Globalization.4.0.11' to 'packages.config'
Successfully installed 'System.Globalization 4.0.11' to Twitch Logs
Adding package 'System.Linq.4.3.0' to folder '\\jgdc01\Users\RyanPearce\Documents\Visual Studio 2015\Projects\Twitch Logs\packages'
Added package 'System.Linq.4.3.0' to folder '\\jgdc01\Users\RyanPearce\Documents\Visual Studio 2015\Projects\Twitch Logs\packages'
Added package 'System.Linq.4.3.0' to 'packages.config'
Successfully installed 'System.Linq 4.3.0' to Twitch Logs
Adding package 'System.Net.NameResolution.4.3.0' to folder '\\jgdc01\Users\RyanPearce\Documents\Visual Studio 2015\Projects\Twitch Logs\packages'
Added package 'System.Net.NameResolution.4.3.0' to folder '\\jgdc01\Users\RyanPearce\Documents\Visual Studio 2015\Projects\Twitch Logs\packages'
Added package 'System.Net.NameResolution.4.3.0' to 'packages.config'
Successfully installed 'System.Net.NameResolution 4.3.0' to Twitch Logs
Adding package 'System.Net.Sockets.4.3.0' to folder '\\jgdc01\Users\RyanPearce\Documents\Visual Studio 2015\Projects\Twitch Logs\packages'
Added package 'System.Net.Sockets.4.3.0' to folder '\\jgdc01\Users\RyanPearce\Documents\Visual Studio 2015\Projects\Twitch Logs\packages'
Added package 'System.Net.Sockets.4.3.0' to 'packages.config'
Successfully installed 'System.Net.Sockets 4.3.0' to Twitch Logs
Adding package 'System.Reflection.4.1.0' to folder '\\jgdc01\Users\RyanPearce\Documents\Visual Studio 2015\Projects\Twitch Logs\packages'
Added package 'System.Reflection.4.1.0' to folder '\\jgdc01\Users\RyanPearce\Documents\Visual Studio 2015\Projects\Twitch Logs\packages'
Added package 'System.Reflection.4.1.0' to 'packages.config'
Successfully installed 'System.Reflection 4.1.0' to Twitch Logs
Adding package 'System.Resources.ResourceManager.4.0.1' to folder '\\jgdc01\Users\RyanPearce\Documents\Visual Studio 2015\Projects\Twitch Logs\packages'
Added package 'System.Resources.ResourceManager.4.0.1' to folder '\\jgdc01\Users\RyanPearce\Documents\Visual Studio 2015\Projects\Twitch Logs\packages'
Added package 'System.Resources.ResourceManager.4.0.1' to 'packages.config'
Successfully installed 'System.Resources.ResourceManager 4.0.1' to Twitch Logs
Adding package 'System.Runtime.Extensions.4.3.0' to folder '\\jgdc01\Users\RyanPearce\Documents\Visual Studio 2015\Projects\Twitch Logs\packages'
Added package 'System.Runtime.Extensions.4.3.0' to folder '\\jgdc01\Users\RyanPearce\Documents\Visual Studio 2015\Projects\Twitch Logs\packages'
Added package 'System.Runtime.Extensions.4.3.0' to 'packages.config'
Successfully installed 'System.Runtime.Extensions 4.3.0' to Twitch Logs
Adding package 'System.Runtime.InteropServices.4.3.0' to folder '\\jgdc01\Users\RyanPearce\Documents\Visual Studio 2015\Projects\Twitch Logs\packages'
Added package 'System.Runtime.InteropServices.4.3.0' to folder '\\jgdc01\Users\RyanPearce\Documents\Visual Studio 2015\Projects\Twitch Logs\packages'
Added package 'System.Runtime.InteropServices.4.3.0' to 'packages.config'
Successfully installed 'System.Runtime.InteropServices 4.3.0' to Twitch Logs
Adding package 'Microsoft.Extensions.Logging.Abstractions.1.0.0' to folder '\\jgdc01\Users\RyanPearce\Documents\Visual Studio 2015\Projects\Twitch Logs\packages'
Added package 'Microsoft.Extensions.Logging.Abstractions.1.0.0' to folder '\\jgdc01\Users\RyanPearce\Documents\Visual Studio 2015\Projects\Twitch Logs\packages'
Added package 'Microsoft.Extensions.Logging.Abstractions.1.0.0' to 'packages.config'
Successfully installed 'Microsoft.Extensions.Logging.Abstractions 1.0.0' to Twitch Logs
Adding package 'Serilog.Extensions.Logging.2.0.2' to folder '\\jgdc01\Users\RyanPearce\Documents\Visual Studio 2015\Projects\Twitch Logs\packages'
Added package 'Serilog.Extensions.Logging.2.0.2' to folder '\\jgdc01\Users\RyanPearce\Documents\Visual Studio 2015\Projects\Twitch Logs\packages'
Added package 'Serilog.Extensions.Logging.2.0.2' to 'packages.config'
Successfully installed 'Serilog.Extensions.Logging 2.0.2' to Twitch Logs
Adding package 'System.Security.Cryptography.Encoding.4.3.0' to folder '\\jgdc01\Users\RyanPearce\Documents\Visual Studio 2015\Projects\Twitch Logs\packages'
Added package 'System.Security.Cryptography.Encoding.4.3.0' to folder '\\jgdc01\Users\RyanPearce\Documents\Visual Studio 2015\Projects\Twitch Logs\packages'
Added package 'System.Security.Cryptography.Encoding.4.3.0' to 'packages.config'
Successfully installed 'System.Security.Cryptography.Encoding 4.3.0' to Twitch Logs
Adding package 'System.Security.Cryptography.Primitives.4.3.0' to folder '\\jgdc01\Users\RyanPearce\Documents\Visual Studio 2015\Projects\Twitch Logs\packages'
Added package 'System.Security.Cryptography.Primitives.4.3.0' to folder '\\jgdc01\Users\RyanPearce\Documents\Visual Studio 2015\Projects\Twitch Logs\packages'
Added package 'System.Security.Cryptography.Primitives.4.3.0' to 'packages.config'
Successfully installed 'System.Security.Cryptography.Primitives 4.3.0' to Twitch Logs
Adding package 'System.Security.Cryptography.Algorithms.4.3.0' to folder '\\jgdc01\Users\RyanPearce\Documents\Visual Studio 2015\Projects\Twitch Logs\packages'
Added package 'System.Security.Cryptography.Algorithms.4.3.0' to folder '\\jgdc01\Users\RyanPearce\Documents\Visual Studio 2015\Projects\Twitch Logs\packages'
Added package 'System.Security.Cryptography.Algorithms.4.3.0' to 'packages.config'
Successfully installed 'System.Security.Cryptography.Algorithms 4.3.0' to Twitch Logs
Adding package 'System.Security.Cryptography.X509Certificates.4.3.0' to folder '\\jgdc01\Users\RyanPearce\Documents\Visual Studio 2015\Projects\Twitch Logs\packages'
Added package 'System.Security.Cryptography.X509Certificates.4.3.0' to folder '\\jgdc01\Users\RyanPearce\Documents\Visual Studio 2015\Projects\Twitch Logs\packages'
Added package 'System.Security.Cryptography.X509Certificates.4.3.0' to 'packages.config'
Successfully installed 'System.Security.Cryptography.X509Certificates 4.3.0' to Twitch Logs
Adding package 'System.Net.Security.4.3.0' to folder '\\jgdc01\Users\RyanPearce\Documents\Visual Studio 2015\Projects\Twitch Logs\packages'
Added package 'System.Net.Security.4.3.0' to folder '\\jgdc01\Users\RyanPearce\Documents\Visual Studio 2015\Projects\Twitch Logs\packages'
Added package 'System.Net.Security.4.3.0' to 'packages.config'
Successfully installed 'System.Net.Security 4.3.0' to Twitch Logs
Adding package 'SuperSocket.ClientEngine.Core.0.10.0' to folder '\\jgdc01\Users\RyanPearce\Documents\Visual Studio 2015\Projects\Twitch Logs\packages'
Added package 'SuperSocket.ClientEngine.Core.0.10.0' to folder '\\jgdc01\Users\RyanPearce\Documents\Visual Studio 2015\Projects\Twitch Logs\packages'
Added package 'SuperSocket.ClientEngine.Core.0.10.0' to 'packages.config'
Successfully installed 'SuperSocket.ClientEngine.Core 0.10.0' to Twitch Logs
Adding package 'System.Text.RegularExpressions.4.3.0' to folder '\\jgdc01\Users\RyanPearce\Documents\Visual Studio 2015\Projects\Twitch Logs\packages'
Added package 'System.Text.RegularExpressions.4.3.0' to folder '\\jgdc01\Users\RyanPearce\Documents\Visual Studio 2015\Projects\Twitch Logs\packages'
Added package 'System.Text.RegularExpressions.4.3.0' to 'packages.config'
Successfully installed 'System.Text.RegularExpressions 4.3.0' to Twitch Logs
Adding package 'System.Threading.4.3.0' to folder '\\jgdc01\Users\RyanPearce\Documents\Visual Studio 2015\Projects\Twitch Logs\packages'
Added package 'System.Threading.4.3.0' to folder '\\jgdc01\Users\RyanPearce\Documents\Visual Studio 2015\Projects\Twitch Logs\packages'
Added package 'System.Threading.4.3.0' to 'packages.config'
Successfully installed 'System.Threading 4.3.0' to Twitch Logs
Adding package 'System.Threading.Timer.4.3.0' to folder '\\jgdc01\Users\RyanPearce\Documents\Visual Studio 2015\Projects\Twitch Logs\packages'
Added package 'System.Threading.Timer.4.3.0' to folder '\\jgdc01\Users\RyanPearce\Documents\Visual Studio 2015\Projects\Twitch Logs\packages'
Added package 'System.Threading.Timer.4.3.0' to 'packages.config'
Successfully installed 'System.Threading.Timer 4.3.0' to Twitch Logs
Adding package 'TwitchLib.Client.Enums.1.0.0' to folder '\\jgdc01\Users\RyanPearce\Documents\Visual Studio 2015\Projects\Twitch Logs\packages'
Added package 'TwitchLib.Client.Enums.1.0.0' to folder '\\jgdc01\Users\RyanPearce\Documents\Visual Studio 2015\Projects\Twitch Logs\packages'
Added package 'TwitchLib.Client.Enums.1.0.0' to 'packages.config'
Successfully installed 'TwitchLib.Client.Enums 1.0.0' to Twitch Logs
Adding package 'TwitchLib.Client.Models.1.0.0' to folder '\\jgdc01\Users\RyanPearce\Documents\Visual Studio 2015\Projects\Twitch Logs\packages'
Added package 'TwitchLib.Client.Models.1.0.0' to folder '\\jgdc01\Users\RyanPearce\Documents\Visual Studio 2015\Projects\Twitch Logs\packages'
Added package 'TwitchLib.Client.Models.1.0.0' to 'packages.config'
Successfully installed 'TwitchLib.Client.Models 1.0.0' to Twitch Logs
Adding package 'WebSocket4Net.0.15.2' to folder '\\jgdc01\Users\RyanPearce\Documents\Visual Studio 2015\Projects\Twitch Logs\packages'
Added package 'WebSocket4Net.0.15.2' to folder '\\jgdc01\Users\RyanPearce\Documents\Visual Studio 2015\Projects\Twitch Logs\packages'
Added package 'WebSocket4Net.0.15.2' to 'packages.config'
Successfully installed 'WebSocket4Net 0.15.2' to Twitch Logs
Adding package 'TwitchLib.Client.2.1.4' to folder '\\jgdc01\Users\RyanPearce\Documents\Visual Studio 2015\Projects\Twitch Logs\packages'
Added package 'TwitchLib.Client.2.1.4' to folder '\\jgdc01\Users\RyanPearce\Documents\Visual Studio 2015\Projects\Twitch Logs\packages'
Added package 'TwitchLib.Client.2.1.4' to 'packages.config'
Successfully installed 'TwitchLib.Client 2.1.4' to Twitch Logs
========== Finished ==========

这最终使我的packages文件夹充满了100mb以上的不需要的库。

以前从未经历过。

有什么想法吗?

1 个答案:

答案 0 :(得分:2)

  

为什么nuget安装一堆系统名称空间引用?

恐怕这可能与软件包TwitchLib.ClientWebSocket4NetSuperSocket.ClientEngine.Core的依赖性有关。

检查错误日志后,您可以找到以下信息:

  

尝试收集程序包的依赖项信息   关于项目“ Twitch Logs”的“ TwitchLib.Client.2.1.4”,   定位到' .NETFramework,Version = v4.6 '

这意味着目标框架是 .NET 4.6 而不是.NET Standard

要重现此问题,我创建了一个项目目标.net 4.6,然后安装了nuget软件包WebSocket4Net但是,确认窗口显示出来,它在安装部分下列出了依赖项,似乎是从WebSocket4Net .NETStandard 1.3依赖项列表中提取的:

enter image description here

NuGet install the wrong dependencies之前我已经报告了类似的问题,您可以尝试使用.net 4.5.2将Microsoft.Data.Services.Client 5.8.2安装到C#项目中。此问题已在5.8.3版中修复。

因此,要解决此问题,我们需要联系此软件包的作者以更新此软件包。软件包SuperSocket.ClientEngine.Core的问题相同。

注意:如果您不想将这些系统依赖项添加到您的项目中,则可以将其从项目中删除。

希望这会有所帮助。