Skip to content

Add ASP.NET Core 3.0 breaking changes #15044

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

Merged
merged 41 commits into from
Oct 16, 2019
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
4ce71d2
Add ASP.NET Core 3.0 breaking changes
scottaddie Oct 8, 2019
93c4269
more work
scottaddie Oct 8, 2019
5b1807f
more work
scottaddie Oct 9, 2019
0690340
Add include files
scottaddie Oct 9, 2019
3cba058
fix build error
scottaddie Oct 9, 2019
0ddd1a8
Acrolinx pass
scottaddie Oct 9, 2019
6b9af12
Eliminate occurrences of 'we'
scottaddie Oct 9, 2019
7bbac57
Add dedicated ASP.NET Core breaking changes page
scottaddie Oct 9, 2019
cee339b
update ToC
scottaddie Oct 9, 2019
01e1329
Alphabetize categories in ToC
scottaddie Oct 9, 2019
cc14910
Sort section on breaking changes page
scottaddie Oct 9, 2019
5ae667f
Fix repo name
scottaddie Oct 9, 2019
87fce7a
Add another breaking change
scottaddie Oct 9, 2019
34304a7
Add API sections for 'not detectable' changes
scottaddie Oct 9, 2019
65ebad3
Test API ref link
scottaddie Oct 10, 2019
62e50bc
Test API ref links
scottaddie Oct 10, 2019
5b87d62
Add more API ref links
scottaddie Oct 10, 2019
cc2d802
Add more API ref links
scottaddie Oct 11, 2019
13922a1
Add more API ref links
scottaddie Oct 11, 2019
55904a4
Add more API ref links
scottaddie Oct 11, 2019
ab15fac
Add more API ref links
scottaddie Oct 11, 2019
40302f1
more work
scottaddie Oct 11, 2019
ffba661
more work
scottaddie Oct 11, 2019
469c978
fixes
scottaddie Oct 12, 2019
b818c0f
more fixes
scottaddie Oct 12, 2019
d33f487
fix link
scottaddie Oct 12, 2019
87ffdd6
more work
scottaddie Oct 12, 2019
62b673d
fix spacing issue in list
scottaddie Oct 14, 2019
5b39fad
order changes by area
scottaddie Oct 14, 2019
d8377e7
fix build errors
scottaddie Oct 14, 2019
621ccca
fix build errors
scottaddie Oct 14, 2019
b52cf90
added periods
mairaw Oct 14, 2019
42253b6
Apply suggestions from code review
scottaddie Oct 15, 2019
2c84018
Code-fence internal API ref links
scottaddie Oct 15, 2019
52934a1
minor edit
scottaddie Oct 15, 2019
609bf64
Apply suggestions from code review
scottaddie Oct 16, 2019
28f42b9
react to feedback
scottaddie Oct 16, 2019
40ced30
fix more links
scottaddie Oct 16, 2019
0418d6d
react to feedback
scottaddie Oct 16, 2019
e2ccdd5
update ms.date
mairaw Oct 16, 2019
bc9f1cb
update ms.date
mairaw Oct 16, 2019
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
178 changes: 174 additions & 4 deletions docs/core/compatibility/2.2-3.0.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
---
title: Breaking changes, version 2.2 to 3.0 - .NET Core
description: Lists the breaking changes from version 2.2 to version 3.0 of .NET Core, ASP.NET Core, and EF Core.
ms.date: "09/10/2019"
ms.date: "10/09/2019"
author: "rpetrusha"
ms.author: "ronpet"
---
# Breaking changes for migration from Version 2.2 to 3.0

> [!IMPORTANT]
> This article is under construction. This is not a complete list of .NET Core breaking changes. For more information on .NET Core breaking changes, you can examine individual [breaking changes issues](https://github.com/dotnet/docs/issues?q=is%3Aissue+is%3Aopen+label%3Abreaking-change) in the dotnet/docs repository on GitHub.
> This article is under construction. This is not a complete list of .NET Core breaking changes. For more information on .NET Core breaking changes, you can examine individual [breaking changes issues](https://github.com/dotnet/docs/issues?q=is%3Aissue+is%3Aopen+label%3Abreaking-change) in the dotnet/docs repository on GitHub.

If you are migrating from version 2.2 to version 3.0 of .NET Core, ASP.NET Core, or EF Core, review the following topics for breaking changes that may affect your app:
If you're migrating from version 2.2 to version 3.0 of .NET Core, ASP.NET Core, or EF Core, review the following topics for breaking changes that may affect your app:

## CoreFx

Expand Down Expand Up @@ -70,7 +70,177 @@ If you are migrating from version 2.2 to version 3.0 of .NET Core, ASP.NET Core,

## ASP.NET Core

[ASP.NET Core breaking change announcements (on GitHub)](https://github.com/aspnet/Announcements/issues?q=is%3Aissue+is%3Aopen+label%3A%22Breaking+change%22+label%3A3.0.0)
[!INCLUDE[AddAuthorization overload assembly change](~/includes/core-changes/aspnetcore/3.0/add-authz-assembly-change.md)]

***

[!INCLUDE[Microsoft.AspNetCore.All shared framework removed](~/includes/core-changes/aspnetcore/3.0/all-shared-framework-removed.md)]

***

[!INCLUDE[MVC precompilation tool deprecated](~/includes/core-changes/aspnetcore/3.0/mvc-precompilation-tool-deprecated.md)]

***

[!INCLUDE[Web API compatibility shim removed](~/includes/core-changes/aspnetcore/3.0/webapi-compat-shim-removed.md)]

***

[!INCLUDE[.NET Framework not supported](~/includes/core-changes/aspnetcore/3.0/netfx-tfm-support.md)]

***

[!INCLUDE[Assembly removal from Microsoft.AspNetCore.App](~/includes/core-changes/aspnetcore/3.0/app-shared-framework-assemblies.md)]

***

[!INCLUDE[MVC types changed to internal](~/includes/core-changes/aspnetcore/3.0/mvc-pubternal-to-internal.md)]

***

[!INCLUDE[empty Kestrel HTTPS assembly removed](~/includes/core-changes/aspnetcore/3.0/empty-kestrel-assembly-removed.md)]

***

[!INCLUDE[obsolete session APIs removed](~/includes/core-changes/aspnetcore/3.0/obsolete-session-apis-removed.md)]

***

[!INCLUDE[Google+ authentication deprecation](~/includes/core-changes/aspnetcore/3.0/google-plus-authn-changes.md)]

***

[!INCLUDE[ObjectPoolProvider removed from WebHostBuilder dependencies](~/includes/core-changes/aspnetcore/3.0/objectpoolprovider-webhostbuilder-dependencies.md)]

***

[!INCLUDE[removed HttpContext.Authentication property](~/includes/core-changes/aspnetcore/3.0/httpcontext-authn-property-removed.md)]

***

[!INCLUDE[removed DefaultHttpContext extensibility](~/includes/core-changes/aspnetcore/3.0/defaulthttpcontext-extensibility-removed.md)]

***

[!INCLUDE[ANCM version 1 removed from hosting bundle](~/includes/core-changes/aspnetcore/3.0/ancmv1-hosting-bundle-removal.md)]

***

[!INCLUDE[obsolete CompactOnMemoryPressure property removed](~/includes/core-changes/aspnetcore/3.0/memorycacheoptions-property-removed.md)]

***

[!INCLUDE[Json.NET types replaced in Authentication APIs](~/includes/core-changes/aspnetcore/3.0/authn-apis-json-types.md)]

***

[!INCLUDE[synchronous IO disabled by default](~/includes/core-changes/aspnetcore/3.0/synchronous-io-disabled.md)]

***

[!INCLUDE[Razor file runtime compilation moved to a package](~/includes/core-changes/aspnetcore/3.0/razor-runtime-compilation-package.md)]

***

[!INCLUDE[IHostingEnvironment and IApplicationLifetime types replaced](~/includes/core-changes/aspnetcore/3.0/ihostingenv-iapplifetime-types-replaced.md)]

***

[!INCLUDE[localization APIs marked obsolete](~/includes/core-changes/aspnetcore/3.0/localization-apis-marked-obsolete.md)]

***

[!INCLUDE[controller action Async suffix removed](~/includes/core-changes/aspnetcore/3.0/action-async-suffix-trimmed.md)]

***

[!INCLUDE[generic host restriction on Startup constructor injection](~/includes/core-changes/aspnetcore/3.0/generic-host-startup-ctor-restriction.md)]

***

[!INCLUDE[ResponseCaching types changed to internal](~/includes/core-changes/aspnetcore/3.0/responsecaching-pubternal-to-internal.md)]

***

[!INCLUDE[DataProtection.AzureStorage uses new Azure Storage APIs](~/includes/core-changes/aspnetcore/3.0/dpazstorage-using-azstorage-apis.md)]

***

[!INCLUDE[HeaderNames fields changed to static readonly](~/includes/core-changes/aspnetcore/3.0/headernames-constants-staticreadonly.md)]

***

[!INCLUDE[HeaderNames fields changed to static readonly](~/includes/core-changes/aspnetcore/3.0/identityui-bootstrap-version.md)]

***

[!INCLUDE[Kestrel request trailer headers moved to new collection](~/includes/core-changes/aspnetcore/3.0/kestrel-request-trailer-headers.md)]

***

[!INCLUDE[SignInAsync throws exception for unauthenticated identity](~/includes/core-changes/aspnetcore/3.0/signinasync-throws-exception.md)]

***

[!INCLUDE[Kestrel transport abstraction layer changes](~/includes/core-changes/aspnetcore/3.0/kestrel-transport-abstractions.md)]

***

[!INCLUDE[OAuthHandler ExchangeCodeAsync signature change](~/includes/core-changes/aspnetcore/3.0/exchangecodeasync-signature-change.md)]

***

[!INCLUDE[DebugLogger class made internal](~/includes/core-changes/aspnetcore/3.0/debuglogger-to-internal.md)]

***

[!INCLUDE[obsolete SignalR APIs](~/includes/core-changes/aspnetcore/3.0/obsolete-signalr-apis.md)]

***

[!INCLUDE[SignalR HandshakeProtocol.SuccessHandshakeData replaced](~/includes/core-changes/aspnetcore/3.0/signalr-successhandshakedata-replaced.md)]

***

[!INCLUDE[SignalR HubConnection methods removed](~/includes/core-changes/aspnetcore/3.0/signalr-hubconnection-methods-removed.md)]

***

[!INCLUDE[SignalR HubConnectionContext constructors changed](~/includes/core-changes/aspnetcore/3.0/signalr-hubconnectioncontext-ctors.md)]

***

[!INCLUDE[SignalR JavaScript client package name change](~/includes/core-changes/aspnetcore/3.0/signalr-js-client-package-name.md)]

***

[!INCLUDE[Microsoft.Extensions.Caching.SqlServer uses the new Microsoft.Data.SqlClient package](~/includes/core-changes/aspnetcore/3.0/new-sqlclient-package.md)]

***

[!INCLUDE[Kestrel connection adapters removed](~/includes/core-changes/aspnetcore/3.0/kestrel-connection-adapters-removed.md)]

***

[!INCLUDE[SignInManager constructor accepts new parameter](~/includes/core-changes/aspnetcore/3.0/signinmanager-ctor-parameter.md)]

***

[!INCLUDE[IAuthorizationPolicyProvider implementations require a new method](~/includes/core-changes/aspnetcore/3.0/iauthzpolicyprovider-new-method.md)]

***

[!INCLUDE[HttpResponse body infrastructure changes](~/includes/core-changes/aspnetcore/3.0/httpresponse-body-changes.md)]

***

[!INCLUDE[SpaServices and NodeServices are obsolete](~/includes/core-changes/aspnetcore/3.0/spaservices-nodeservices-obsolete.md)]

***

[!INCLUDE[Identity UI uses static web assets feature](~/includes/core-changes/aspnetcore/3.0/identityui-static-web-assets.md)]

***

## Entity Framework Core

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
### Async suffix trimmed from controller action names

As part of addressing [aspnet/AspNetCore#4849](https://github.com/aspnet/AspNetCore/issues/4849), ASP.NET Core MVC trims the suffix `Async` from action names by default. This change affects both routing and link generation.

#### Version introduced

3.0

#### Old behavior

Consider the following ASP.NET Core MVC controller:

```csharp
public class ProductController : Controller
{
public async IActionResult ListAsync()
{
var model = await DbContext.Products.ToListAsync();
return View(model);
}
}
```

Prior to ASP.NET Core 3.0, the action is routable via `Product/ListAsync`. Link generation requires specifying the `Async` suffix. For example:

```cshtml
<a asp-controller="Product" asp-action="ListAsync">List</a>
```

#### New behavior

In ASP.NET Core 3.0, the action is routable via `Product/List`. Link generation requires not specifying the `Async` suffix. For example:

```cshtml
<a asp-controller="Product" asp-action="List">List</a>
```

This change doesn't affect names specified using the `[ActionName]` attribute. The new behavior can be disabled by setting `MvcOptions.SuppressAsyncSuffixInActionNames` to `false` in `Startup.ConfigureServices`:

```csharp
services.AddMvc(options =>
{
options.SuppressAsyncSuffixInActionNames = false;
});
```

#### Reason for change

By convention, asynchronous .NET methods are suffixed with `Async`. However, when a method defines an MVC action, it's undesirable to use the `Async` suffix.

#### Recommended action

If your app depends on MVC actions retaining the `Async` suffix in the name, choose one of the following mitigations:

- Use the `[ActionName]` attribute to preserve the original name.
- Disable the renaming entirely by setting `MvcOptions.SuppressAsyncSuffixInActionNames` to `false` in `Startup.ConfigureServices`:

```csharp
services.AddMvc(options =>
{
options.SuppressAsyncSuffixInActionNames = false;
});
```

#### Category

ASP.NET Core

#### Affected APIs

Not detectable via API analysis
31 changes: 31 additions & 0 deletions includes/core-changes/aspnetcore/3.0/add-authz-assembly-change.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
### AddAuthorization overload lives in a different assembly

We renamed the core `AddAuthorization` methods that used to live in `Microsoft.AspNetCore.Authorization` to be `AddAuthorizationCore`. The old `AddAuthorization` methods still exist, but are in the `Microsoft.AspNetCore.Authorization.Policy` package instead. Apps that are using both should see no impact. Apps that weren't using the policy package need to switch to using `AddAuthorizationCore`.

#### Version introduced

3.0

#### Old behavior

`AddAuthorization` methods existed in `Microsoft.AspNetCore.Authorization`.

#### New behavior

`AddAuthorization` methods exist in `Microsoft.AspNetCore.Authorization.Policy`. `AddAuthorizationCore` is the new name for the old methods.

#### Reason for change

We wanted the better `AddAuthorization` name to add all of the common services needed for authorization. We decided to take over the old name in 3.0.

#### Recommended action

Either add a reference to `Microsoft.AspNetCore.Authorization.Policy` or use `AddAuthorizationCore` instead.

#### Category

ASP.NET Core

#### Affected APIs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There has to be a commented-out section with Affected APIs as a level-3 head. The individual APIs should be in a bulleted list, and they should be formatted as fenced docIDs (e.g., `T:System.String`.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the heads up. Out of curiosity, what's the purpose of the commented-out section?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will be used by diagnostic tools (the compatibility analyzers) to diagnose potential compatibility issues.


[AddAuthorization(Action<AuthorizationOptions>)](/dotnet/api/microsoft.extensions.dependencyinjection.authorizationservicecollectionextensions.addauthorization?view=aspnetcore-2.2#Microsoft_Extensions_DependencyInjection_AuthorizationServiceCollectionExtensions_AddAuthorization_Microsoft_Extensions_DependencyInjection_IServiceCollection_System_Action_Microsoft_AspNetCore_Authorization_AuthorizationOptions__)
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
### Removed Microsoft.AspNetCore.All shared framework

Earlier this year, we announced the `Microsoft.AspNetCore.App` metapackage (see https://github.com/aspnet/Announcements/issues/287). That announcement said:

> The existing `Microsoft.AspNetCore.All` meta-package will continue to be made available throughout the 2.x lifecycle, but **we recommend customers move to the new Microsoft.AspNetCore.App meta-package** and then add individual references to any of the removed packages if their app requires it.

For migration instructions, see [Migrating from Microsoft.AspNetCore.All to Microsoft.AspNetCore.App](/aspnet/core/fundamentals/metapackage?view=aspnetcore-2.1#migrating-from-microsoftaspnetcoreall-to-microsoftaspnetcoreapp).

As of ASP.NET Core 3.0, the `Microsoft.AspNetCore.All` metapackage and the matching `Microsoft.AspNetCore.All` shared framework is no longer produced.

This package will be available in ASP.NET Core 2.2 and will continue to receive servicing updates in ASP.NET Core 2.1.

#### Version introduced

3.0

#### Old behavior

Apps were able to use the `Microsoft.AspNetCore.All` metapackage to target the `Microsoft.AspNetCore.All` shared framework on .NET Core.

#### New behavior

There is no `Microsoft.AspNetCore.All` shared framework as part of .NET Core 3.0.

#### Reason for change

As [previously announced](https://github.com/aspnet/Announcements/issues/287), the `Microsoft.AspNetCore.All` metapackage included a large number of external dependencies.

#### Recommended action

Migrate your app to use the `Microsoft.AspNetCore.App` framework. Components that were previously available in `Microsoft.AspNetCore.All` are **still available on NuGet**. Those components are now deployed with your app instead of being included in the shared framework.

#### Category

ASP.NET Core

#### Affected APIs

Any API that was only present in the `Microsoft.AspNetCore.All` framework.
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
### AspNetCoreModule V1 removed from Windows Hosting Bundle

The Windows Hosting Bundle won't contain AspNetCoreModule (ANCM) V1 in the ASP.NET Core 3.0 release.

ANCM V2 is backwards compatible with ANCM OutOfProcess and is recommended for use with ASP.NET Core 3.0 apps.

For discussion, see https://github.com/aspnet/AspNetCore/issues/7095.

#### Version introduced

3.0

#### Old behavior

ANCM V1 is included in the Windows Hosting Bundle.

#### New behavior

ANCM V1 isn't included in the Windows Hosting Bundle.

#### Reason for change

ANCM V2 is backwards compatible with ANCM OutOfProcess and is recommended for use with ASP.NET Core 3.0 apps.

#### Recommended action

Use ANCM V2 with ASP.NET Core 3.0 apps.

If ANCM V1 is required, it can be installed using the ASP.NET Core 2.1 or 2.2 Windows Hosting Bundle.

This change will break ASP.NET Core 3.0 apps that:

- Explicitly opted into using ANCM V1 with `<AspNetCoreModuleName>AspNetCoreModule</AspNetCoreModuleName>`.
- Have a custom *web.config* file with `<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />`.

#### Category

ASP.NET Core

#### Affected APIs

Not detectable via API analysis
Loading