Skip to content

Document IPNetwork and ForwardedHeadersOptions.KnownNetworks obsolescence for .NET 10 #47899

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 8, 2025

This PR documents the breaking change introduced in .NET 10 Preview 7 where Microsoft.AspNetCore.HttpOverrides.IPNetwork and ForwardedHeadersOptions.KnownNetworks have been marked as obsolete in favor of System.Net.IPNetwork and ForwardedHeadersOptions.KnownIPNetworks.

The change affects developers using forwarded headers middleware who will now receive compiler warning ASPDEPR005 when using the obsolete APIs:

// Previous behavior - now obsolete
app.UseForwardedHeaders(new ForwardedHeadersOptions
{
    KnownNetworks.Add(new(IPAddress.Loopback, 8))
});

// New behavior - recommended approach
app.UseForwardedHeaders(new ForwardedHeadersOptions
{
    KnownIPNetworks.Add(new(IPAddress.Loopback, 8))
});

Changes made:

  • Created new breaking change documentation at docs/core/compatibility/aspnet-core/10.0/ipnetwork-knownnetworks-obsolete.md
  • Added ASP.NET Core section to the .NET 10 compatibility overview page
  • Updated the table of contents to include the new ASP.NET Core 10.0 section

The documentation follows the established template and includes comprehensive migration guidance, affected APIs, and code examples to help developers update their applications.

Fixes #47622.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.


Internal previews

📄 File 🔗 Preview link
docs/core/compatibility/10.0.md Breaking changes in .NET 10
docs/core/compatibility/aspnet-core/10/ipnetwork-knownnetworks-obsolete.md IPNetwork and ForwardedHeadersOptions.KnownNetworks are obsolete
docs/core/compatibility/toc.yml docs/core/compatibility/toc

@Copilot Copilot AI changed the title [WIP] Document https://github.com/aspnet/Announcements/issues/523 Document IPNetwork and ForwardedHeadersOptions.KnownNetworks obsolescence for .NET 10 Aug 8, 2025
Copilot finished work on behalf of gewarren August 8, 2025 18:23
@Copilot Copilot AI requested a review from gewarren August 8, 2025 18:23
@gewarren gewarren marked this pull request as ready for review August 8, 2025 22:01
@gewarren gewarren requested a review from a team as a code owner August 8, 2025 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Document https://github.com/aspnet/Announcements/issues/523
2 participants