Multi-target NuGet libraries for net8.0 and net10.0#2
Merged
Conversation
Add net8.0 alongside net10.0 as a target framework for the three NuGet-published libraries (EncDotNet.Iso8211, EncDotNet.S57, and EncDotNet.Noaa) to broaden consumer reach to .NET 8 LTS. The ChartViewer, Console, Benchmarks, and UnitTests projects continue to target net10.0 only. The libraries' source already uses only APIs and language features available in .NET 8, so no source changes or #if guards are required. TargetFramework is explicitly cleared in each csproj to override the single-TFM default inherited from Directory.Build.props. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The three NuGet-published libraries (
EncDotNet.Iso8211,EncDotNet.S57,EncDotNet.Noaa) currently only ship anet10.0assembly, which excludes consumers still on .NET 8 LTS. Addingnet8.0as a second TFM broadens reach to the large pool of LTS-pinned projects without requiring them to upgrade their runtime.Approach
Each of the three library
.csprojfiles now declares<TargetFrameworks>net8.0;net10.0</TargetFrameworks>. The viewer, console, benchmarks, and unit-test projects are intentionally left asnet10.0only, since the viewer is shipped with its own embedded runtime and the rest are internal consumers.A source-level audit confirmed the libraries already use only APIs and language features available in .NET 8 (e.g.
required/init,ArgumentNullException.ThrowIfNull,System.Buffers.Binary,ImmutableArray). No#ifguards, shims, or source changes were needed.Notes for reviewers
<TargetFramework></TargetFramework>is set explicitly in each library csproj to clear the single-TFM default inherited fromDirectory.Build.props. Without this, the inherited property wins and onlynet10.0builds. An alternative would be to make the inherited default conditional, but keeping the override local to the libraries leaves the rest of the repo untouched.dotnet packproduces packages containing bothlib/net8.0/andlib/net10.0/(DLL + XML doc) folders.