These are dependencies of Nuget package System.Memory
. We use older .Net framework versions and I noticed that if I use 4.6.1, there is an additional dependency on System.Numerics.Vectors
(a framework DLL I think) which isn't needed in 4.5->4.6.
It seems the opposite to normal, that a newer version of .Net would require more dependencies.
Why is this, and will I see any difference e.g. in performance?
It seems the opposite to normal, that a newer version of .Net would require more dependencies.
The System.Memory
package contains libraries for the following target frameworks.
When consuming the package in a .NET Framework 4.5 project, the System.Memory.dll
from the .NET Standard 1.1 target is used, because that is the highest version that it can consume, see this reference. However, this version does not use Vector<T>
or other vector types. Consequently, it does not depend on System.Numerics.Vectors
.
The same as for .NET Framework 4.5 applies, since .NET Standard 1.3 is the highest version that a .NET Framework 4.6 project can consume. As there is only a .NET Standard 1.1 version provided, it will fall back to that.
When consuming the package in a .NET Framework 4.6.1 project, the corresponding version of System.Memory.dll
is used. This version uses the Vector<T>
type which is only available in:
System.Numerics.Vectors
NuGet packageThe .NET Framework 4.6.1 target has a dependency to the System.Numerics.Vectors
package, because it would not be available otherwise.
[...] will I see any difference e.g. in performance?
There might be a performance benefit, since Vector<T>
is a SIMD-accelerated type. It is used in a helper class for spans, where Vector.IsHardwareAccelerated
is checked, so I guess there is a performance-related reason behind using Vector<T>
.
Why does that package even have a separate .NET Framework 4.6.1 target, if it could could use .NET Standard? That is best explained in the linked reference itself.
[...] While NuGet considers .NET Framework 4.6.1 as supporting .NET Standard 1.5 through 2.0, there are several issues with consuming .NET Standard libraries that were built for those versions from .NET Framework 4.6.1 projects. [...]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With