Why is NuGet loading apparently unnecessary dependencies?

When installing System.Collections.Immutable NuGet loads assemblies like System.Runtime , although I already installed this assembly with .NET 4.6.1.

In addition, directories under lib (for example, \ System.Runtime.4.0.0 \ lib \ net45 packages) do not contain DLL files, but simply empty files called _._ .

Why is this happening? Why is this necessary? What am I missing here?

NuGet Magazine:

 Install-Package System.Collections.Immutable -Version 1.1.37 Attempting to gather dependency information for package 'System.Collections.Immutable.1.1.37' with respect to project 'ConsoleApplication1', targeting '.NETFramework,Version=v4.6.1' Attempting to resolve dependencies for package 'System.Collections.Immutable.1.1.37' with DependencyBehavior 'Lowest' Resolving actions to install package 'System.Collections.Immutable.1.1.37' Resolved actions to install package 'System.Collections.Immutable.1.1.37' GET https://www.nuget.org/api/v2/package/System.Collections/4.0.0 Installing System.Collections 4.0.0. Adding package 'System.Collections.4.0.0' to folder 'd:\workspace\ConsoleApplication1\packages' Added package 'System.Collections.4.0.0' to folder 'd:\workspace\ConsoleApplication1\packages' Added package 'System.Collections.4.0.0' to 'packages.config' Successfully installed 'System.Collections 4.0.0' to ConsoleApplication1 GET https://www.nuget.org/api/v2/package/System.Diagnostics.Debug/4.0.0 Installing System.Diagnostics.Debug 4.0.0. Adding package 'System.Diagnostics.Debug.4.0.0' to folder 'd:\workspace\ConsoleApplication1\packages' Added package 'System.Diagnostics.Debug.4.0.0' to folder 'd:\workspace\ConsoleApplication1\packages' Added package 'System.Diagnostics.Debug.4.0.0' to 'packages.config' Successfully installed 'System.Diagnostics.Debug 4.0.0' to ConsoleApplication1 GET https://www.nuget.org/api/v2/package/System.Globalization/4.0.0 Installing System.Globalization 4.0.0. Adding package 'System.Globalization.4.0.0' to folder 'd:\workspace\ConsoleApplication1\packages' Added package 'System.Globalization.4.0.0' to folder 'd:\workspace\ConsoleApplication1\packages' Added package 'System.Globalization.4.0.0' to 'packages.config' Successfully installed 'System.Globalization 4.0.0' to ConsoleApplication1 GET https://www.nuget.org/api/v2/package/System.Linq/4.0.0 Installing System.Linq 4.0.0. Adding package 'System.Linq.4.0.0' to folder 'd:\workspace\ConsoleApplication1\packages' Added package 'System.Linq.4.0.0' to folder 'd:\workspace\ConsoleApplication1\packages' Added package 'System.Linq.4.0.0' to 'packages.config' Successfully installed 'System.Linq 4.0.0' to ConsoleApplication1 GET https://www.nuget.org/api/v2/package/System.Resources.ResourceManager/4.0.0 Installing System.Resources.ResourceManager 4.0.0. Adding package 'System.Resources.ResourceManager.4.0.0' to folder 'd:\workspace\ConsoleApplication1\packages' Added package 'System.Resources.ResourceManager.4.0.0' to folder 'd:\workspace\ConsoleApplication1\packages' Added package 'System.Resources.ResourceManager.4.0.0' to 'packages.config' Successfully installed 'System.Resources.ResourceManager 4.0.0' to ConsoleApplication1 GET https://www.nuget.org/api/v2/package/System.Runtime/4.0.0 Installing System.Runtime 4.0.0. Adding package 'System.Runtime.4.0.0' to folder 'd:\workspace\ConsoleApplication1\packages' Added package 'System.Runtime.4.0.0' to folder 'd:\workspace\ConsoleApplication1\packages' Added package 'System.Runtime.4.0.0' to 'packages.config' Successfully installed 'System.Runtime 4.0.0' to ConsoleApplication1 GET https://www.nuget.org/api/v2/package/System.Runtime.Extensions/4.0.0 Installing System.Runtime.Extensions 4.0.0. Adding package 'System.Runtime.Extensions.4.0.0' to folder 'd:\workspace\ConsoleApplication1\packages' Added package 'System.Runtime.Extensions.4.0.0' to folder 'd:\workspace\ConsoleApplication1\packages' Added package 'System.Runtime.Extensions.4.0.0' to 'packages.config' Successfully installed 'System.Runtime.Extensions 4.0.0' to ConsoleApplication1 GET https://www.nuget.org/api/v2/package/System.Threading/4.0.0 Installing System.Threading 4.0.0. Adding package 'System.Threading.4.0.0' to folder 'd:\workspace\ConsoleApplication1\packages' Added package 'System.Threading.4.0.0' to folder 'd:\workspace\ConsoleApplication1\packages' Added package 'System.Threading.4.0.0' to 'packages.config' Successfully installed 'System.Threading 4.0.0' to ConsoleApplication1 GET https://www.nuget.org/api/v2/package/System.Collections.Immutable/1.1.37 Installing System.Collections.Immutable 1.1.37. Adding package 'System.Collections.Immutable.1.1.37' to folder 'd:\workspace\ConsoleApplication1\packages' Added package 'System.Collections.Immutable.1.1.37' to folder 'd:\workspace\ConsoleApplication1\packages' Added package 'System.Collections.Immutable.1.1.37' to 'packages.config' Successfully installed 'System.Collections.Immutable 1.1.37' to ConsoleApplication1 
+5
source share
1 answer

I think this is due to changes that happen to the dotnet / cli kernel. It supports a dependency chain, which is much more important in donet core, because you do not have a fully installed infrastructure. This explains why the lib\net45 empty, in fact there is nothing, because they are part of the BCL installed on your computer.

+1
source

Source: https://habr.com/ru/post/1244755/


All Articles