我一定要包括所有System.Collections.Immutable依赖呢? [英] Do I have to include all System.Collections.Immutable dependencies?

查看:1870
本文介绍了我一定要包括所有System.Collections.Immutable依赖呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚从(较旧的) Microsoft.Bcl.Immutable 的NuGet包切换到<一个href="https://www.nuget.org/packages/System.Collections.Immutable/"><$c$c>System.Collections.Immutable并惊讶地发现在我的项目中的所有这些新的软件包依赖关系:

I just switched from (an older) Microsoft.Bcl.Immutable NuGet package to System.Collections.Immutable and was surprised to find all these new package dependencies in my project:

System.Collections
System.Diagnostics.Debug
System.Globalization
System.Linq
System.Resources.ResourceManager
System.Runtime
System.Runtime.Extensions
System.Threading

它们被列为的NuGet包的依赖关系,所以他们必须有一个正确的,但他们显然也已经安装在我的电脑,我的目标环境(Azure的BTW),因为它们都与框架。

They are listed as dependencies of the NuGet package, so they have a right to be there, yet they are obviously also already installed on my PC and my target environment (Azure btw) as they come with the framework.

我已经有大量的在我的项目包,并想避免由于这8个包的额外开销,如果可能的话(并且没有拍摄自己的脚)。

I already have a large number of packages in my project and would like to avoid the additional overhead caused by these 8 packages, if possible (and without shooting myself in the foot).

它是安全的删除这些依赖关系?
难道我现在要使用这些包在我的项目,因为它们可能会有所不同,从他们的安装版本和我的项目的某些部分,现在可能使用了错误的呢? (由于一些DLL链接疯狂?)

Is it safe to remove these dependencies?
Do I now have to use these packages throughout my project because they might differ from their installed versions and some portion of my project might now use the wrong ones? (due to some DLL linking madness?)

编辑:只是为了完整性,因为没有评论之前:的依赖是实际的包(未命名),并必须下载,我靶向和.NET 4.6编译工作在VS2015。这是完全有可能的,虽然那东西已经过时,而且包没有被正常加载?

Just for completeness, as there was a comment before: The dependencies are actual packages (not namespaces) and have to be downloaded, I'm targeting and compiling with .NET 4.6, working in VS2015. It's entirely possible though that something is outdated and the packages do not have to be loaded normally?

推荐答案

您只是看到有保持的很多的NuGet包的副作用的。软件包支持的目标数量巨大,故为晚迅速增殖。我看到Xamarin的OSX和iOS,Windows Phone的8.0和8.1,Windows应用商店,CoreCLR(开源项目),.NET 4.5,MonoTouch的iOS和Android和.NETCore(Silverlight的)支持。

You are just seeing a side-effect of the Nuget package having to keep a lot of people happy. The package supports an enormous number of targets, it is proliferating rapidly as of late. I see support for Xamarin for OSX and iOS, Windows Phone 8.0 and 8.1, Windows Store, CoreCLR (the open source project), .NET 4.5, MonoTouch for iOS and Android and .NETCore (Silverlight).

这些依赖包只包含的引用程序集的,即通常安装在C种:\ Program Files文件X86 \引用程序集目录。该的NuGet包不走的机会,这样的引用程序集可能会丢失,包括整个套件和kaboodle。

These dependent packages just contain reference assemblies, the kind that are normally installed in your c:\program files x86\reference assemblies directory. The Nuget package doesn't take the chance that such a reference assembly might be missing and includes the whole kit and kaboodle.

在它所有的下载,包安装程序运行,并增加了引用您实际的需要的在您的项目。不难看出发生了什么事情,只要打开你的项目的引用节点。如果你的目标的。NET 4.5及以上的桌面版,共展宏图的增加是引用的一个的,只是System.Collections.Immutable。是的,你可以删除它们。

After it is all downloaded, the package installer runs and adds the references you actually need in your project. Easy to see what happened, just open the References node of your project. If your targeted the desktop version of .NET 4.5 and up, the grand total of added references is one, just System.Collections.Immutable. Yes, you can remove them.

这篇关于我一定要包括所有System.Collections.Immutable依赖呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆