gpt4 book ai didi

c# - 为什么 nuget 安装一堆系统命名空间引用?

转载 作者:行者123 更新时间:2023-12-03 19:34:24 27 4
gpt4 key购买 nike

我正在尝试从 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 的文件夹充满了不需要的库。

以前从未经历过这种情况。

有任何想法吗?

最佳答案

Why is nuget installing a bunch of system namespace references?



恐怕是包 TwitchLib.Client依赖的问题, WebSocket4NetSuperSocket.ClientEngine.Core .

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

Attempting to gather dependency information for package 'TwitchLib.Client.2.1.4' with respect to project 'Twitch Logs', targeting '.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 ,您可以尝试安装 Microsoft.Data.Services.Client 5.8.2到带有 .net 4.5.2 的 C# 项目。此问题已在 5.8.3 版中修复。

所以,为了解决这个问题,我们需要联系这个包的作者来更新这个包。包 SuperSocket.ClientEngine.Core 的相同问题.

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

希望这可以帮助。

关于c# - 为什么 nuget 安装一堆系统命名空间引用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51286413/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com