Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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 <xref:System.MissingMethodException> or <xref:System.TypeLoadException>.

## 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<TOptions>`
- `Microsoft.AspNetCore.Mvc.MvcCompatibilityOptions`
- `Microsoft.AspNetCore.Mvc.CompatibilityVersion`
1 change: 1 addition & 0 deletions aspnetcore/breaking-changes/11/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
3 changes: 2 additions & 1 deletion aspnetcore/mvc/compatibility-version.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -17,6 +17,7 @@ The <xref:Microsoft.Extensions.DependencyInjection.MvcCoreMvcBuilderExtensions.S

* The next minor version of ASP.NET Core may provide a new `CompatibilityVersion` value.
* `CompatibilityVersion` values `Version_2_0` through `Version_2_2` are marked `[Obsolete(...)]`.
* The compatibility version APIs are removed in ASP.NET Core 11. For more information, see [MVC compatibility options removed](/aspnet/core/breaking-changes/11/mvc-compatibility-options-removed).
* See [Breaking API changes in Antiforgery, CORS, Diagnostics, Mvc, and Routing](https://github.com/aspnet/Announcements/issues/387). This list includes breaking changes for compatibility switches.

To see how `SetCompatibilityVersion` works with ASP.NET Core 2.x apps, select the [ASP.NET Core 2.2 version of this article](?view=aspnetcore-2.2&preserve-view=true).
Expand Down
6 changes: 2 additions & 4 deletions aspnetcore/mvc/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Overview of ASP.NET Core MVC
author: ardalis
description: Learn how ASP.NET Core MVC is a rich framework for building web apps and APIs using the Model-View-Controller design pattern.
ms.author: tdykstra
ms.date: 04/29/2026
ms.date: 08/05/2026
uid: mvc/overview
---
# Overview of ASP.NET Core MVC
Expand Down Expand Up @@ -228,9 +228,7 @@ Tag Helpers provide an HTML-friendly development experience and a rich IntelliSe

## Compatibility version

The <xref:Microsoft.Extensions.DependencyInjection.MvcCoreMvcBuilderExtensions.SetCompatibilityVersion*> 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 <xref:mvc/compatibility-version>.
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 <xref:mvc/compatibility-version> and [MVC compatibility options removed](/aspnet/core/breaking-changes/11/mvc-compatibility-options-removed).

## Additional resources

Expand Down
2 changes: 2 additions & 0 deletions aspnetcore/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading