Multitargeting .NetStandard and netx.0 #110689
-
Hi, as a library developer currently targeting .Net standard 2.0/2.1 for max compatibility, is there any benefit to also multi target different dotnet core versions so System.Text.Json could potentially use functionality only available in newer dotnet versions? Current setup: |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
You don't need to pay additional effort for transitive features. The implementations of libraries are picked based on entry application. The .NET 9 version of System.Text.Json will always be used for .NET 9 application, regardless to the libraries using it. If your application can benefit from using newer features directly, multi-targeting is a good idea then. |
Beta Was this translation helpful? Give feedback.
-
Alright, thanks for the answer. I was a bit confused bit this snippet as found on https://learn.microsoft.com/en-us/dotnet/standard/library-guidance/cross-platform-targeting: |
Beta Was this translation helpful? Give feedback.
You don't need to pay additional effort for transitive features. The implementations of libraries are picked based on entry application. The .NET 9 version of System.Text.Json will always be used for .NET 9 application, regardless to the libraries using it.
If your application can benefit from using newer features directly, multi-targeting is a good idea then.