Quantcast
Channel: Active questions tagged nuget-package - Stack Overflow
Viewing all articles
Browse latest Browse all 3067

Best Practice for dotnet nuget package that references other nuget packages

$
0
0

I have read the Microsoft docs for Cross-platform targeting. However, it's still not clear to me what the best practice is to handle package references from within your shared library's csproj.

Let's say I have a custom nuget package that needs to target netstandard2.0 and net5.0. And, that custom package relies on Microsoft.Extensions.Logging.Abstractions.

Should I:

A) reference 6.0.0 of Microsoft.Extensions.Logging.Abstractions because it is the latest?

B) reference 2.2.0 because it is the latest that was released for my lowest target (netstandard2.0)?

C) use conditional ItemGroups to target 5.0.0 for net5.0 and 2.2.0 for netstandard2.0?

What happens when a new target is released by Microsoft (e.g. net6.0)? If I go with option C, do I need to add the target to handle conditional package references despite Microsoft's guidance to stick to netstandard2.0?


Viewing all articles
Browse latest Browse all 3067

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>