3
votes

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.
1
What are these extra dependencies? Please tell us the specific packages that has this issue, which can let us confirm this issue in our side. In addition, the latest version of NuGet in VS2015 Update 3 is version 3.5. Please upgrade it to version 3.5 to check whether this issue still exist.Weiwei
VS 2015 Update 3 installs Nuget 3.4.4, not 3.5. Nuget 3.5 is still in RC and still has this issue above. Before installing VS Update 3, when adding the Microsoft.IdentityModel.Clients.ActiveDirectory nuget package, no additional Core libraries were included in the dependency chain. After installing Update 3, the Core libraries started being added in the dependency chain. I installed Nuget 3.5 RC and have the same issue. Why are Core libraries being included as dependencies when adding a .Net Standard 1.4 library targeting .Net 4.6.1?Brett Mathe
If nobody can explain it, it sounds like it should be submitted as an issue to nuget. I'll give it a couple more days; maybe I'm missing something.Kevin
My question would be, does your app actually work without those System.X assemblies. I can answer it for you, no it doesn't :), you need those packages as those are not included in the .NET 4.6.1 installation on your PC.Tom Kuijsten
According to this table: docs.microsoft.com/en-us/dotnet/articles/standard/library .Net Standard 1.4 is included in 4.6.1. And to answer your question, yes the library worked just fine before all the Core dependencies started being included.Brett Mathe

1 Answers

0
votes

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