Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

MvcCoreMvcBuilderExtensions.SetCompatibilityVersion Method

Definition

Namespace:
Microsoft.Extensions.DependencyInjection
Assembly:
Microsoft.AspNetCore.Mvc.Core.dll
Package:
Microsoft.AspNetCore.App.Ref v10.0.0
Package:
Microsoft.AspNetCore.App.Ref v11.0.0-preview.4.26230.115
Package:
Microsoft.AspNetCore.Mvc.Core v2.1.0
Package:
Microsoft.AspNetCore.Mvc.Core v2.2.0
Package:
Microsoft.AspNetCore.App.Ref v3.0.1
Package:
Microsoft.AspNetCore.App.Ref v3.1.10
Package:
Microsoft.AspNetCore.App.Ref v5.0.0
Package:
Microsoft.AspNetCore.App.Ref v6.0.36
Package:
Microsoft.AspNetCore.App.Ref v7.0.5
Package:
Microsoft.AspNetCore.App.Ref v8.0.19
Package:
Microsoft.AspNetCore.App.Ref v9.0.8
Source:
MvcCoreMvcBuilderExtensions.cs
Source:
MvcCoreMvcBuilderExtensions.cs
Source:
MvcCoreMvcBuilderExtensions.cs

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Caution

This API is obsolete and will be removed in a future version. Consider removing usages.

Sets the CompatibilityVersion for ASP.NET Core MVC for the application.

[System.Obsolete("This API is obsolete and will be removed in a future version. Consider removing usages.", DiagnosticId="ASP5001", UrlFormat="https://aka.ms/aspnetcore-warnings/{0}")]
public static Microsoft.Extensions.DependencyInjection.IMvcBuilder SetCompatibilityVersion(this Microsoft.Extensions.DependencyInjection.IMvcBuilder builder, Microsoft.AspNetCore.Mvc.CompatibilityVersion version);
public static Microsoft.Extensions.DependencyInjection.IMvcBuilder SetCompatibilityVersion(this Microsoft.Extensions.DependencyInjection.IMvcBuilder builder, Microsoft.AspNetCore.Mvc.CompatibilityVersion version);
[<System.Obsolete("This API is obsolete and will be removed in a future version. Consider removing usages.", DiagnosticId="ASP5001", UrlFormat="https://aka.ms/aspnetcore-warnings/{0}")>]
static member SetCompatibilityVersion : Microsoft.Extensions.DependencyInjection.IMvcBuilder * Microsoft.AspNetCore.Mvc.CompatibilityVersion -> Microsoft.Extensions.DependencyInjection.IMvcBuilder
static member SetCompatibilityVersion : Microsoft.Extensions.DependencyInjection.IMvcBuilder * Microsoft.AspNetCore.Mvc.CompatibilityVersion -> Microsoft.Extensions.DependencyInjection.IMvcBuilder
<Extension()>
Public Function SetCompatibilityVersion (builder As IMvcBuilder, version As CompatibilityVersion) As IMvcBuilder

Parameters

builder
IMvcBuilder

The IMvcBuilder.

version
CompatibilityVersion

The CompatibilityVersion value to configure.

Returns

The IMvcBuilder.

Attributes

Applies to


Feedback

Was this page helpful?