I am working with my .NET class library project that targets Multiple .NET frameworks and now after having downloaded the .NET Core 2.0 SDK in my Windows 10 machine I am trying to target .NET Standard 2.0
as well.
<TargetFrameworks>net45;net46;netstandard1.0;netstandard1.3;netstandard2.0</TargetFrameworks>
The problem is that when the NuGet package generated by Visual Studio (2017) after compilation is opened via NuGet Package Explorer it shows that for .NET Standard 2.0
there are no dependencies.
Shouldn't it be having NETStandard.Library 2.0.0 as a dependency?
If so is it necessary (at-least till an update is released for VS) that a dependency is explicitly specified in the NuGet package for NETStandard.Library 2.0.0?
To be certain that it wasn't an isolated case with my project I created another project and added Newtonsoft.Json as a dependency. The result was still the same.
The default NETStandard.Library
version is still 1.6.1
when publishing for .NET Standard versions lower than 2.0. While the 2.0.0
version is technically the same (it has the same list of dependencies for the older .NET Standard versions), you risk creating downgrade warnings for consuming projects that reference version 1.6.1
.
For .NET Standard versions 2.0 and higher, no dependency on NETStandard.Library
is needed so your library will show "No Dependencies" as long as you don't add any additional NuGet packages.
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