From 76e0b2a312190bf37a0ab50ed69b1850d0a16882 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 5 Aug 2026 14:19:03 +0000 Subject: [PATCH 1/2] Initial plan From 8a634a176c5cb1e139f2c06b0e715de5f9df6d13 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 5 Aug 2026 14:21:33 +0000 Subject: [PATCH 2/2] Add breaking change article for removed MVC compatibility options Co-authored-by: Youssef1313 <31348972+Youssef1313@users.noreply.github.com> --- .../11/mvc-compatibility-options-removed.md | 57 +++++++++++++++++++ aspnetcore/breaking-changes/11/overview.md | 1 + aspnetcore/mvc/compatibility-version.md | 3 +- aspnetcore/mvc/overview.md | 6 +- aspnetcore/toc.yml | 2 + 5 files changed, 64 insertions(+), 5 deletions(-) create mode 100644 aspnetcore/breaking-changes/11/mvc-compatibility-options-removed.md diff --git a/aspnetcore/breaking-changes/11/mvc-compatibility-options-removed.md b/aspnetcore/breaking-changes/11/mvc-compatibility-options-removed.md new file mode 100644 index 000000000000..4f15d13db49d --- /dev/null +++ b/aspnetcore/breaking-changes/11/mvc-compatibility-options-removed.md @@ -0,0 +1,57 @@ +--- +title: "Breaking change: MVC compatibility options removed" +ai-usage: ai-assisted +description: "Learn about the breaking change in ASP.NET Core 11 where the MVC compatibility version APIs, including CompatibilityVersion and SetCompatibilityVersion, are removed." +ms.date: 08/05/2026 +--- +# MVC compatibility options removed + +The MVC compatibility version APIs, such as `CompatibilityVersion` and `SetCompatibilityVersion`, are removed in ASP.NET Core 11. These APIs were no-ops since ASP.NET Core 3.0 and have been marked obsolete since ASP.NET Core 6. + +## Version introduced + +.NET 11 Preview 7 + +## Previous behavior + +Previously, the compatibility version APIs existed and could be called, but they produced an obsoletion warning at build time and had no effect at runtime: + +```csharp +services.AddMvc() + .SetCompatibilityVersion(CompatibilityVersion.Latest); +``` + +## New behavior + +Starting in ASP.NET Core 11, these APIs no longer exist. Code that calls them fails to compile, and existing binaries that reference them fail at runtime with a or . + +## Type of breaking change + +This change can affect [source compatibility](/dotnet/core/compatibility/categories#source-compatibility) and [binary compatibility](/dotnet/core/compatibility/categories#binary-compatibility). + +## Reason for change + +The APIs have been marked obsolete since ASP.NET Core 6 and did nothing since ASP.NET Core 3.0, so they served no value. For more information, see [dotnet/aspnetcore#67077](https://github.com/dotnet/aspnetcore/pull/67077). + +## Recommended action + +Remove any usages of these APIs. For example, change the following code: + +```csharp +services.AddMvc() + .SetCompatibilityVersion(CompatibilityVersion.Latest); +``` + +To: + +```csharp +services.AddMvc(); +``` + +## Affected APIs + +- `Microsoft.Extensions.DependencyInjection.MvcCoreMvcBuilderExtensions.SetCompatibilityVersion` +- `Microsoft.Extensions.DependencyInjection.MvcCoreMvcCoreBuilderExtensions.SetCompatibilityVersion` +- `Microsoft.AspNetCore.Mvc.Infrastructure.ConfigureCompatibilityOptions` +- `Microsoft.AspNetCore.Mvc.MvcCompatibilityOptions` +- `Microsoft.AspNetCore.Mvc.CompatibilityVersion` diff --git a/aspnetcore/breaking-changes/11/overview.md b/aspnetcore/breaking-changes/11/overview.md index ed97514b43a5..9335ea03b37a 100644 --- a/aspnetcore/breaking-changes/11/overview.md +++ b/aspnetcore/breaking-changes/11/overview.md @@ -21,6 +21,7 @@ If you're migrating an app to ASP.NET Core 11, the breaking changes listed here | [Hosting emits OpenTelemetry HTTP semantic-convention tags by default](http-activity-otel-semconv.md) | Behavioral change | | [Kestrel tightens HTTP protocol compliance](kestrel-strict-protocol-compliance.md) | Behavioral change | | [Microsoft.OpenApi upgraded to 3.x](microsoft-openapi-3x.md) | Source incompatible | +| [MVC compatibility options removed](mvc-compatibility-options-removed.md) | Binary/source incompatible | | [Obsolete Blazor APIs removed](blazor-obsolete-apis-removed.md) | Source incompatible | | [OpenAPI document includes all ProducesResponseType entries per status code](openapi-multiple-produces-per-status.md) | Behavioral change | | [OpenAPI server URL no longer has a trailing slash when PathBase is empty](openapi-server-url-trailing-slash.md) | Behavioral change | diff --git a/aspnetcore/mvc/compatibility-version.md b/aspnetcore/mvc/compatibility-version.md index b0a71198abba..d897bd46b34e 100644 --- a/aspnetcore/mvc/compatibility-version.md +++ b/aspnetcore/mvc/compatibility-version.md @@ -4,7 +4,7 @@ author: tdykstra description: Discover how the Startup class in ASP.NET Core configures services and the app's request pipeline. monikerRange: '>= aspnetcore-2.1' ms.author: tdykstra -ms.date: 9/25/2019 +ms.date: 08/05/2026 uid: mvc/compatibility-version --- # Compatibility version for ASP.NET Core MVC @@ -17,6 +17,7 @@ The method allows an app to opt-in or opt-out of potentially breaking behavior changes introduced in ASP.NET Core MVC 2.1 or later. - -For more information, see . +The `SetCompatibilityVersion` method allowed an app to opt in or opt out of potentially breaking behavior changes introduced in ASP.NET Core MVC 2.1 or later. The method is a no-op for ASP.NET Core 3.0 and later apps, and it's removed in ASP.NET Core 11. For more information, see and [MVC compatibility options removed](/aspnet/core/breaking-changes/11/mvc-compatibility-options-removed). ## Additional resources diff --git a/aspnetcore/toc.yml b/aspnetcore/toc.yml index 2b39f43589e2..b54e23e65d26 100644 --- a/aspnetcore/toc.yml +++ b/aspnetcore/toc.yml @@ -29,6 +29,8 @@ items: href: breaking-changes/11/kestrel-strict-protocol-compliance.md - name: Microsoft.OpenApi upgraded to 3.x href: breaking-changes/11/microsoft-openapi-3x.md + - name: MVC compatibility options removed + href: breaking-changes/11/mvc-compatibility-options-removed.md - name: Obsolete Blazor APIs removed href: breaking-changes/11/blazor-obsolete-apis-removed.md - name: OpenAPI document includes all ProducesResponseType entries per status code