Avoid package downgrades for (implicit) NETStandard.Library package
See original GitHub issueCurrently (in the 1.0 SDK), the implicit version of NETStandard.Library package is 1.6.1. With the 2.0 tooling, this will change to (presumably) 2.0.0. If someone creates a NuGet package targeting .NET Standard using the 2.0 tooling and someone else who is using the 1.0 tooling tries to reference that package from a .NET Standard project, they will get a package downgrade warning for NETStandard.Library.
We need to avoid this.
We could set PrivateAssets="all"
on the implicit package reference in order to prevent it from being a dependency expressed on the NuGet packages that are generated. That would prevent the package downgrade issue, but .NET Framework projects need the NETStandard.Library package to be referenced in order to get the right facades to support .NET Standard at runtime.
Ideally, the package generated would have a dependencies group for net45 (or whatever the lowest version of the .NET Framework supported would be) that would express a dependency on the NETStandard.Library package, which wouldn’t apply to projects targeting other frameworks. (It’s possible that Xamarin or other targets might also need the dependency).
However, it’s not possible to specify dependencies groups this way when creating a NuGet package from an SDK-style project. There is a NuGet issue filed to enable this: https://github.com/NuGet/Home/issues/2300
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (8 by maintainers)
Top GitHub Comments
Also, does it work when you have ProjectReferences instead of PackageReferences?
Is the automatic reference to
NETStandard.Library.NETFramework
supposed to be an SDK feature or a NuGet feature? (=> classic csproj withPackageReference
)