Repository navigation
Update to .NET 11, drop .NET 8 and adopt MTP - #1182
Merged
stuartlang-je merged 10 commits intoNov 25, 2026
Merged
Conversation
- Update the .NET SDK to 11.0.100 and use Microsoft.Testing.Platform for `dotnet test`. - Replace the net8.0 TFM with net10.0 as .NET 8 and 9 are now out of support. - Run the library tests on both net10.0 and net11.0. - Update Microsoft.AspNetCore.WebUtilities to 2.3.14 to resolve CVE-2026-118750. - Update xunit.v3 to 4.0.3 and remove Microsoft.NET.Test.Sdk and xunit.runner.visualstudio. - Replace coverlet.msbuild with coverlet.MTP and generate coverage reports using the ReportGenerator tool. - Update GitHubActionsTestLogger to 3.0.5 for MTP support. - Fix test for HttpClient cancellation behaviour change in .NET 11. - Use the HashCode-based header hashing for all TFMs from net8.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replace the use of `QueryHelpers.ParseQuery()` for matching form content with an internal parser that has the same behaviour. This removes the library's dependency on Microsoft.AspNetCore.WebUtilities, along with its transitive dependencies, so consumers no longer receive vulnerability reports for a package that was only used for a single method. The tests compare the parser's output to `QueryHelpers.ParseQuery()` for a set of edge cases and for randomly generated content. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1182 +/- ##
==========================================
+ Coverage 99.33% 99.54% +0.21%
==========================================
Files 15 13 -2
Lines 896 873 -23
Branches 205 214 +9
==========================================
- Hits 890 869 -21
+ Misses 4 3 -1
+ Partials 2 1 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🟡 Changes recommended
Repeated form values cause quadratic string copying, while the build script can fail when the .NET 10 runtime is missing or local tools are invoked from outside the repository directory.
3 open issues
What changed in this PR
Modernizes the library’s build and test infrastructure for .NET 11 and removes its production dependency on ASP.NET Core WebUtilities while preserving form-matching behavior.
Changes:
- Replaces the library’s
net8.0target withnet10.0and runs library tests on .NET 10 and 11. - Migrates testing and coverage to Microsoft.Testing.Platform, coverlet.MTP, and the ReportGenerator tool.
- Adds an internal form parser with compatibility tests against
QueryHelpers.ParseQuery().
| File | Description |
|---|---|
| tests/HttpClientInterception.Tests/JustEat.HttpClientInterception.Tests.csproj | Adds dual-runtime testing and parser comparison dependencies. |
| tests/HttpClientInterception.Tests/FormUrlEncodedParserTests.cs | Adds edge-case, randomized, and form-matching tests. |
| tests/HttpClientInterception.Tests/Examples.cs | Updates cancellation expectations for .NET 11. |
| tests/HttpClientInterception.Benchmarks/JustEat.HttpClientInterception.Benchmarks.csproj | Adds the .NET 11 benchmark target. |
| src/HttpClientInterception/PublicAPI/net10.0/PublicAPI.Unshipped.txt | Records the .NET 10 public API surface. |
| src/HttpClientInterception/PublicAPI/net10.0/PublicAPI.Shipped.txt | Initializes the .NET 10 shipped API baseline. |
| src/HttpClientInterception/JustEat.HttpClientInterception.csproj | Updates targets and removes unnecessary dependencies. |
| src/HttpClientInterception/HttpRequestInterceptionBuilderExtensions.cs | Uses the internal parser for form matching. |
| src/HttpClientInterception/HttpClientInterceptorOptions.cs | Preserves modern header hashing on newer targets. |
| src/HttpClientInterception/FormUrlEncodedParser.cs | Implements dependency-free form parsing. |
| src/HttpClientInterception/CompatibilitySuppressions.xml | Suppresses baseline errors for removed .NET 8 overloads. |
| samples/SampleApp/SampleApp.csproj | Moves the sample application to .NET 11. |
| samples/SampleApp.Tests/SampleApp.Tests.csproj | Updates the sample tests and removes VSTest dependencies. |
| samples/SampleApp.Tests/ReposTests.cs | Switches deserialization to System.Text.Json. |
| global.json | Selects the .NET 11 SDK and Microsoft.Testing.Platform. |
| Directory.Packages.props | Updates dependencies for the testing migration. |
| Directory.Build.targets | Removes MSBuild-based coverage reporting. |
| Directory.Build.props | Removes legacy coverage configuration. |
| build.ps1 | Adds runtime installation, MTP coverage, and merged reporting. |
| .vscode/launch.json | Updates the sample debug path to .NET 11. |
| .github/workflows/update-dotnet-sdk.yml | Removes the obsolete test SDK update entry. |
| .github/workflows/dependabot-approve.yml | Removes the obsolete test SDK approval entry. |
| .github/workflows/build.yml | Installs .NET 10 alongside the selected SDK. |
| .github/dependabot.yml | Allows WebUtilities minor and patch updates. |
| .config/dotnet-tools.json | Registers the ReportGenerator tool. |
Review effort: Balanced
Collect the values for each key and join them once, rather than copying the accumulated string each time a key is repeated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Run from the repository root so global.json, which selects the SDK and the test runner, and the local tools manifest are always found. - Install missing runtimes even when the required SDK is already present. - Set DOTNET_ROOT for local installs so the test applications use the locally installed runtimes. - Use the platform path separator when updating PATH. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replace Test-DotNetRuntimes with Get-MissingDotNetRuntime, which uses a singular noun and returns the missing runtimes so the caller can report them with Write-Output instead of Write-Host. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
coverlet.MTP reports branches that coverlet.msbuild did not, which reduced the coverage reported to Codecov. Add tests for them, and for the form parser branches that were only covered by the copy of the parser compiled into the tests, rather than the library itself. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The netstandard2.0 and net472 builds reference a version of System.Text.Json that supports JsonTypeInfo<T>, so the overloads of WithJsonContent<T>() and RegisterGetFromJson<T>() no longer need to be limited to .NET. This avoids a breaking change for applications targeting .NET 8 and 9, which now use the netstandard2.0 build instead of the removed net8.0 build, so the package validation suppressions are no longer needed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 30, 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.

A bit of maintenance, now that .NET 8 and 9 are out of support and .NET 11 is out. There's also a CVE in
Microsoft.AspNetCore.WebUtilitiesthat was breaking restore (NU1902 +TreatWarningsAsErrors).The main changes are in the first two commits, the rest are follow-ups from review and CI.
Update to .NET 11 SDK, drop .NET 8 and adopt MTP
11.0.100and optdotnet testinto Microsoft.Testing.Platform viaglobal.jsonnet8.0TFM withnet10.0, so we now targetnetstandard2.0;net472;net10.0net10.0andnet11.0. CI now installs the .NET 10 SDK as well, and so doesbuild.ps1when it installs the SDK locallyMicrosoft.AspNetCore.WebUtilitiesto2.3.14for CVE-2026-118750. We never touched the vulnerableFileBufferingReadStream, but audit flags it all the samexunit.v3to4.0.3, which uses MTP by default, and dropMicrosoft.NET.Test.Sdkandxunit.runner.visualstudiocoverlet.msbuild(VSTest only) forcoverlet.MTP. The 95% threshold is still enforced, and the merged report and step summary are now generated by the ReportGenerator dotnet tool inbuild.ps1GitHubActionsTestLoggerto3.0.5for its MTP support (--report-github)#if NET8_0should have beenNET8_0_OR_GREATER, otherwisenet10.0would have quietly fallen back to the old header hashing codeHttpClientobserves cancellation when buffering the response content, soInject_Latency_For_Http_Get_With_Cancellationnow expects aTaskCanceledExceptionthereMicrosoft.AspNetCore.WebUtilitiesin Dependabot, so we get patches like this one in futureRemove dependency on Microsoft.AspNetCore.WebUtilities
We only used
QueryHelpers.ParseQuery()forForFormContent(), so I've replaced it with a small internalFormUrlEncodedParserthat copies its behaviour, quirks and all (case-insensitive keys, keys without a=aren't decoded, repeated values are joined with,but empty ones are dropped, asStringValues.ToString()does). The tests compare the parser's output with the realParseQuery(), for a bunch of edge cases plus 100k seeded random inputs. It's no longer a dependency of the library, so no more CVE noise for consumers, and thenet10.0package has no dependencies at all now 🙂Versioning
Dropping
net8.0means .NET 8/9 consumers now get thenetstandard2.0assets, which didn't have theJsonTypeInfo<T>overloads ofWithJsonContent<T>()andRegisterGetFromJson<T>(), so package validation flagged them as removed. The System.Text.Json package hasJsonTypeInfo<T>fornetstandard2.0, so those overloads are now compiled for every TFM instead and no package validation suppressions are needed. However, falling back tonetstandard2.0on .NET 8/9 still drops runtime behaviour gated behind#if NET6_0_OR_GREATER/#if NET8_0_OR_GREATER(most notably the synchronousInterceptingHttpMessageHandler.Send()override,ReadOnlyMemoryContentsupport inForFormContent(), and AOT/trimming annotations), so this bumpsAssemblyVersionandVersionPrefixto6.0.0.Also,
Inject_Latency_For_Http_Getflaked once locally under coverage (the 50ms delay measured as 49.95ms). It's not new and I couldn't reproduce it, but running two TFMs makes it a little more likely, so it could do with a small tolerance at some point.🤖 Generated with Claude Code