Package Dependency Issue


I am trying to use MathNet.Numerics in a project targeting .Net Standard 1.3 but package requires NETStandard.Library >= 2.0.1. The issue is that .Net Standard 1.3 uses NETStandard.Library version 1.6.1 inherently.

I believe that the dependency on version NETStandard.Library >=2.0.1 should be removed.

Do you agree? What was the resoning behind this dependency?


(Christoph Rüegg) #2

To my understanding the version of the NETStandard.Library is orthogonal to the target framework version. Indeed, NETStandard.Library 2.0.1 fully supports .Net Standard 1.3. What prevents you from upgrading to the newer library version, even when targetting only .Net Standard 1.3? While there are lots of reasons for targeting older framework versions, I don’t see a point in using older library versions, as long as all the target frameworks are still fully supported.

Technically we cannot easily downgrade to 1.6.1 since 1.6.1 only supports up to .Net Standard 1.3, while 2.0.1 also supports .Net Standard 2.0 directly, which we target directly as well (and where going through 1.6.1 would negate most of the advantages).

(Adam) #3

The NETStandard.Library used is implicitly defined by the target framework. For netstandard1.3, NETStandard.Library is 1.6.1. You cannot change the NETStandard.Libary version through NuGet, but rather have to edit the csproj to manually specify it:

    <!-- The NetStardardImplicitPackageVersion is implicitly set to 1.6.1 for the TargetFramework of netstandard1.3
         We're setting it to 2.0.1 due to MathNet.Numerics NuGet dependency of NETStandard.Library (>= 2.0.1) -->

When you set this in the csproj, you can no longer rely on VS setting the library version if you choose to update the target framework. This, of course, is less than desirable.


Also check out the following link. There is a decent discussion there about this topic.