Repository navigation
build: target only Microsoft-supported frameworks (net10.0, net11.0, netstandard2.0) - #419
Merged
Merged
Conversation
- Library: net8.0;netstandard2.1;netstandard2.0 -> net11.0;net10.0;netstandard2.0 (.NET 8 and 9 reached end of support on 2026-11-10; netstandard2.0 kept for .NET Framework 4.6.2+) - Tests: multi-target net11.0;net10.0 - CI: build/CodeQL install 10.x + 11.x SDKs; publish uses 11.x - Tests: use decimal literals for decimal range test data; .NET 11's more precise double->decimal conversion made 0.1 != 0.1m - Add implement-feature skill and the plan for this issue under .claude/ Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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.



Fixes #418
Summary
As of 2026-11-12 the supported .NET versions are .NET 10 (LTS) and .NET 11 (STS). .NET 8 and .NET 9 both reached end of support on 2026-11-10 (per the official
releases-index.json).Library (
src/GuardClauses/GuardClauses.csproj)net8.0;netstandard2.1;netstandard2.0→net11.0;net10.0;netstandard2.0netstandard2.0is kept so .NET Framework 4.6.2–4.8.1, which Microsoft still supports, keeps working.netstandard2.1is dropped. The runtimes it uniquely served (.NET Core 3.x, .NET 5–9, Xamarin, Mono) are out of Microsoft support. There is noNETSTANDARD2_1-specific code, and remaining consumers (for example Unity) resolve thenetstandard2.0asset.Tests
net11.0;net10.0, so the full suite runs on both supported runtimes.GuardAgainstOutOfRangeForEnumerableDecimalcases failed on net11.0.ClassDatapasseddoublerange values that xUnit converts todecimal.(decimal)0.1is now0.1000000000000000055511151231, so the in-range item0.1mfell below the range start.decimalliterals, and some pre-existing trailing whitespace in the file is fixed.CI
build.yml: installs the10.xand11.xSDKs instead of8.x.codeql-analysis.yml: adds asetup-dotnetstep for10.xand11.x, so autobuild can build net11.0 before runner images ship the .NET 11 SDK.publish.yml: SDK6.0.x→11.x.Other
CallerArgumentExpressionAttributepolyfill doc comment..claude/skills/implement-feature(copied from another NimblePros repo and adapted for this repo's build/test/format commands) and the plan for this issue:.claude/plans/2026-11-12-issue-418-update-tfms.md..NET 11 double → decimal conversion change (why the test data changed)
What Microsoft's breaking-change entry says:
doubletodecimalkept only 15 significant digits (7 forfloat), so(decimal)0.1came out as0.1.decimal, giving about 28 significant digits.new decimal(double),Convert.ToDecimal,IConvertibleand the generic-math conversions. The reverse direction (decimaltodouble/float) andBigIntegerconversions changed as well.G15(orG7forfloat) and parsing that back todecimal.0.1m, not(decimal)0.1. That's the fix applied in this PR.Confirmed locally with a small console app doing the same conversion on both runtimes:
doublevalue0.10.10.100000000000000005551115123110.110.110.0999999999999996447286321200.30.30.2999999999999999888977697537200.5200.5200.5(exact in binary, so unchanged)The cast,
Convert.ToDecimal,Convert.ChangeTypeandnew decimal()all gave these results. xUnit usesConvert.ChangeTypeto turnobject[]ClassDataintodecimalparameters, which is why those two tests broke.Impact on GuardClauses: the library code never converts between floating-point types and
decimal(src/has no such conversions). Only test data written asdoubleliterals was affected. The remaining casts inGuardAgainstNegativeOrZero.csconvert whole-number inputs, which are exact.The same page also lists a related numeric change, Math.Round and MathF.Round return correctly rounded results. It doesn't affect this library.
This is a breaking change for net5–net9 consumers. They now resolve the
netstandard2.0asset, which doesn't include:ReadOnlySpan<char>overloads ofGuard.Against.Empty/WhiteSpace(NET5_0_OR_GREATER)TryGetNonEnumeratedCountfast pathUnder NuGet guidance that calls for a major version bump (6.0.0). I left
<Version>at 5.0.0 on purpose, so merging doesn't auto-publish throughpublish.yml. Bump the version and add release notes when you're ready to ship.net10.0andnet11.0currently compile identically. If you'd rather contributors only need the .NET 10 SDK,net10.0;netstandard2.0would serve the same consumers.dotnet format --verify-no-changesalready fails onmain, with about 980 pre-existing whitespace violations. I didn't reformat the whole repo; the files this PR touches pass a scoped check.Verification
dotnet build -c Release: succeeded, 0 warnings, 0 errorsdotnet test -c Release: 959/959 passed on net10.0 and 959/959 on net11.0dotnet format --verify-no-changes --include <changed .cs files>: cleanlib/net10.0,lib/net11.0andlib/netstandard2.011.xSDK.🤖 Generated with Claude Code