Skip to content

Add support for .NET 11 #2112

Open

Description

@waldekmastykarz

.NET 11 shipped on Nov 10, 2026. We should build Dev Proxy on .NET 11 and let plugin authors target it, without breaking existing plugins or users.

Current state

  • End users aren't affected. Release builds are self-contained single-file, so the Docker image, the dev container feature, brew, winget and the install scripts don't depend on the installed .NET version.
  • The build already fails with the .NET 11 SDK, even on net10.0. No SDK version is pinned, and the .NET 11 SDK's newer code analyzers raise 36 CA1860 errors. They fail the build because of AnalysisMode=AllEnabledByDefault + TreatWarningsAsErrors. Contributors with only the .NET 11 SDK can't build main.
  • Plugins built for .NET 11 can't load today. The DevProxy.Abstractions package installs in a net11.0 project, but Dev Proxy runs on .NET 10, which can't load a plugin compiled for .NET 11.

Required changes (verified in a local trial; all 601 tests pass on net11)

  • Change net10.0 → net11.0 in all 9 projects.
  • Update the Microsoft.EntityFrameworkCore.Sqlite and Microsoft.Extensions.* packages from 10.0.x to 11.x.
  • Regenerate the packages.lock.json files (CI restores with --locked-mode).
  • Remove the Microsoft.Extensions.Logging.Abstractions reference for the net11.0 target. It's now redundant, and NuGet's NU1510 warning (an error with warnings-as-errors) fails restore.
  • Fix the new analyzer errors:
    • CA1860 (Any() → Count): 36 instances.
    • CA1307: new char + StringComparison overloads in ProxyUtils.cs and WatchedHostExtractor.cs.
    • CA2016: pass the cancellation token to WriteLineAsync in ApiCommand.cs, LogsCommand.cs and StdioCommand.cs.
    • CA2027: Task.WhenAny + Task.Delay in EngineInactivityTimeoutTests.cs (warning).
  • Update the hard-coded net10.0 paths:
    • DevProxy.Integration.Tests/CommandExitCodeTests.cs and ProcessSmokeTests.cs. These break 17 tests if left.
    • .vscode/launch.json and scripts/local-build.ps1.
    • .github/workflows/create-release.yml, including the Abstractions DLL and pack paths.
  • Set dotnet-version: 11.0.x in dotnet.yml, codeql-analysis.yml and create-release.yml (both jobs).
  • Consider pinning the SDK or analyzer version (global.json or AnalysisLevel), so a new SDK release doesn't break the build again.
  • Consider turning tests back on in CI. The step is commented out in dotnet.yml, so CI didn't catch the test path problem above.
  • Check .NET 11's supported operating system list for the release platforms (win/linux/osx, x64/arm64/x86).

DevProxy.Abstractions (plugin authors)

  • Target both net10.0 and net11.0, with matching package versions per target (EF Core and Microsoft.Extensions.* 10.x vs 11.x). Don't drop net10.0: existing plugin projects target it.
  • Update the release workflow to pack and upload both targets.
  • Document in the package README that plugins must reference DevProxy.Abstractions and the shared Microsoft.Extensions.* packages with Private=false / ExcludeAssets=runtime, as DevProxy.Plugins does. Otherwise Dev Proxy loads a second copy and plugin types don't match its own. This becomes more likely once plugins and Dev Proxy are built against different .NET versions.

Compatibility with existing plugins

I verified that the unmodified DevProxy.Plugins.dll from the v4.0.0 release (built for net10.0) runs on a .NET 11 build of Dev Proxy. Mocks, latency, simulated errors, the Graph plugin (EF Core + SQLite) and the reporters all worked. Existing plugins should keep working as long as the Abstractions API doesn't change.

.NET 8 and 9 are out of support, but projects still use them, so we shouldn't break them. The package has only ever shipped net10.0 builds, so net10.0;net11.0 doesn't remove anything that works today. Adding net8.0/net9.0 targets would be new support and is out of scope here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions