question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Avoid package downgrades for (implicit) NETStandard.Library package

See original GitHub issue

Currently (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:closed
  • Created 7 years ago
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
gulbananacommented, May 5, 2017

Also, does it work when you have ProjectReferences instead of PackageReferences?

0reactions
dasMullicommented, May 5, 2017

Is the automatic reference to NETStandard.Library.NETFramework supposed to be an SDK feature or a NuGet feature? (=> classic csproj with PackageReference)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Detected package downgrade warning (dotnet core, vs 2017)
I have just updated all my nuget packages for my solution (dotnet core 1.1 project). I am now getting the following warnings and...
Read more >
NuGet Package Dependency Resolution
The Direct dependency wins rule can result in a downgrade of the package version, thus potentially breaking other dependencies in the graph.
Read more >
RT.Comb 4.0.1
RT.COMB. Purpose. This small .NET Core library does two things: generates "COMB" Guid values in C#; and,; extracts the DateTime value from an...
Read more >
Migrating Complex NuGet solutions to Paket
This is Paket's way of highlighting the fact that the package references for projects across the solution are currently inconsistent. In other ...
Read more >
7124b168cc7e0c6a11120728ad...
dotnet remove package global.json overview ... Develop libraries with the CLI Create templates for the CLI ... NET Standard object is serializable
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found