feat: Update target frameworks to net8.0#69
Merged
Conversation
Replace netcoreapp3.1 and net6.0 with net8.0 (keeping netstandard2.0 and net462), mirroring the dotnet-core packages. This is not a breaking change: netstandard2.0/net462 still cover .NET Framework consumers, netcoreapp3.1 is not used by the consuming SDKs, and net6.0/netcoreapp3.1 are out of support, so no major version bump is required. The JsonConverterHelpers ref-struct helpers (ArrayHelper/ObjectHelper) could not be used under net8.0 because the .NET 7+ runtime enables byref-field ref-safety analysis regardless of LangVersion, causing CS8350/CS8352 at every call site. Annotate the Utf8JsonReader parameters as 'scoped' to declare that the helpers never capture a reference to the reader, and raise LangVersion to 11 so the annotation is available. This unblocks net8.0 for all consumers. Simplify the HttpProperties handler guard from '#if NETCOREAPP || NET6_0' to '#if NETCOREAPP'. The branch selects SocketsHttpHandler (for ConnectTimeout support), which exists on all .NET Core 2.1+ / .NET 5+ targets, so there is no version floor to enforce; the unversioned NETCOREAPP symbol already covers every such target and the '|| NET6_0' clause was redundant. Update CI and release actions to install the 8.0 SDK and target net8.0.
kinyoklion
approved these changes
Jun 16, 2026
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.
Overview
Updates
dotnet-sdk-internalto support net8.0, matching the target framework set used by thedotnet-corepackages (server-ai,telemetry,server,common).Resolves SDK-1435.
Target frameworks:
netstandard2.0;netcoreapp3.1;net462;net6.0→netstandard2.0;net462;net8.0Not a breaking change
Dropping
netcoreapp3.1andnet6.0does not warrant a major version bump:netstandard2.0andnet462continue to cover .NET Framework consumers.netcoreapp3.1is not used by the consuming SDKs.The CS8352/CS8350 problem (why this stalled previously)
The
JsonConverterHelpersref-struct helpers (ArrayHelper/ObjectHelper) could not be consumed under net8.0: the .NET 7+ runtime enables byref-field ref-safety analysis regardless ofLangVersion, so the compiler assumed these ref structs might capture a reference to theUtf8JsonReaderpassed to their methods, producingCS8350/CS8352at every call site (including plain inlineNext(ref reader)calls — so every downstream consumer would hit it on net8.0).Fix: annotate the
Utf8JsonReaderparameters asscopedto declare that the helpers never capture a reference to the reader (which is true), and raiseLangVersionto11so the annotation is available.scopedis a compile-time-only annotation — verified to build cleanly onnetstandard2.0andnet462as well. There is direct precedent:dotnet-core'sserver-aishipsLangVersion 11with the identical TFM set.Other changes
HttpProperties: simplified the handler guard#if NETCOREAPP || NET6_0→#if NETCOREAPP(the branch selectsSocketsHttpHandler, available on all .NET Core 2.1+/.NET 5+ targets, so no version floor applies; the|| NET6_0clause was redundant).Testing
Note
Medium Risk
TFM matrix changes can affect consumers that targeted net6.0/netcoreapp3.1 directly; public helper signatures changed to scoped ref, which downstream code must compile against on modern runtimes.
Overview
Aligns LaunchDarkly.InternalSdk with the dotnet-core TFM set by moving the modern target from net6.0 / netcoreapp3.1 to net8.0 while keeping netstandard2.0 and net462. Default build/test frameworks and GitHub Actions (setup-dotnet 8.0, CI matrix, full release framework_target) are updated accordingly; LangVersion is raised to 11.
JsonConverterHelpers
ArrayHelper/ObjectHelperAPIs now usescoped ref Utf8JsonReaderso net8.0 ref-safety analysis (CS8350 / CS8352) passes without changing runtime behavior. Tests mirror those signatures.HttpProperties uses
#if NETCOREAPPonly (drops redundant NET6_0). System.Collections.Immutable is no longer pulled in for the removed netcoreapp3.1 TFM.Reviewed by Cursor Bugbot for commit 74fefad. Bugbot is set up for automated code reviews on this repo. Configure here.