Skip to content

Commit

Permalink
Migration: IHostApplicationLifetime+Environments (dotnet#14190)
Browse files Browse the repository at this point in the history
  • Loading branch information
guardrex authored Sep 6, 2019
1 parent 4cad485 commit 81d065b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions aspnetcore/migration/22-to-30.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ author: rick-anderson
description: Learn how to migrate an ASP.NET Core 2.2 project to ASP.NET Core 3.0.
ms.author: riande
ms.custom: mvc
ms.date: 09/03/2019
ms.date: 09/06/2019
uid: migration/22-to-30
---
# Migrate from ASP.NET Core 2.2 to 3.0
Expand Down Expand Up @@ -173,7 +173,9 @@ General advice:
* If the app uses authentication/authorization features such as `AuthorizePage` or `[Authorize]`, place the call to `UseAuthentication` and `UseAuthorization` **after** `UseRouting` (and **after** `UseCors` if CORS Middleware is used).
* Replace `UseMvc` or `UseSignalR` with `UseEndpoints`.
* If the app uses [CORS](xref:security/cors) scenarios, such as `[EnableCors]`, place the call to `UseCors` before any other middlewares that use CORS (for example, place `UseCors` before `UseAuthentication`, `UseAuthorization`, and `UseMvc`).
* Replace `IHostingEnvironment` with `IWebHostEnvironment` and add a `using` statement for the `Microsoft.Extensions.Hosting` namespace.
* Replace `IHostingEnvironment` with `IWebHostEnvironment` and add a `using` statement for the <xref:Microsoft.Extensions.Hosting?displayProperty=fullName> namespace.
* Replace `IApplicationLifetime` with <xref:Microsoft.Extensions.Hosting.IHostApplicationLifetime> (<xref:Microsoft.Extensions.Hosting?displayProperty=fullName> namespace).
* Replace `EnvironmentName` with <xref:Microsoft.Extensions.Hosting.Environments> (<xref:Microsoft.Extensions.Hosting?displayProperty=fullName> namespace).

The following is an example of `Startup.Configure` in a typical ASP.NET Core 2.2 app:

Expand Down

0 comments on commit 81d065b

Please sign in to comment.