Kevin
Kevin

Reputation: 1005

Nuget 3.4.4 downloading NET Standard 1.4 libraries for project targeting .NET Framework 4.6.1

After installing VS 2015 update 3 (and nuget 3.4.4), I've noticed more dependencies being installed into my 4.6.1 projects when I import something dependent upon .NETStandard 1.4.

Since .NET Framework 4.6.1 implements .NET Standard 1.4, why is nuget bringing in each System.X assembly? Shouldn't it know the target framework already has what it needs?

Steps to reproduce what I'm seeing (and confused about):

  1. VS 2015 Update 3, upgrade nuget to 3.5-rc1 (but you don't have to).
  2. New Console application targeting .NET Framework 4.6.1
  3. Install-Package Microsoft.IdentityModel.Clients.ActiveDirectory
  4. Notice it has a dependency on .NET Standard 1.4 (which my target framework implements)
  5. Notice the System.X (System.IO, System.Collections, System.Linq, etc.) that get included. That doesn't seem necessary and wasn't happening before I updated nuget.

Upvotes: 3

Views: 830

Answers (1)

Weiwei
Weiwei

Reputation: 3766

After I downgrade my NuGet Package Manager to version 3.3 in my Visual Studio 2015 Update 3, I found when I install the Microsoft.IdentityModel.Clients.ActiveDirectory package in my project, there doesn't add the dependencies into my project. So this issue caused by the NuGet version.

According to the release note for NuGet 3.4, it starts for "Support for the netstandard and netstandardapp framework monikers". It means NuGet 3.4 starts supports .NET Standard and .NET Standard Framework related app.

Please compare the Dependencies part in NuGet 3.3 and NuGet 3.4 or higher version for the same package. Before version 3.4, it shows "Unsupported", but start from version 3.4, it shows ".NET standard, version 1.4". This is why all the dependencies would be added into your project when you install NuGet 3.4.4. enter image description here

Upvotes: 0

Related Questions