Update 22-to-30.md - edit for IHostingEnvironment changes. (#13893)

pull/13897/head
Shayne Boyer 2019-08-18 07:25:54 -04:00 committed by Luke Latham
parent fc20dde03f
commit c5ea40975a
1 changed files with 2 additions and 1 deletions

View File

@ -4,7 +4,7 @@ author: tdykstra
description: Learn how to migrate an ASP.NET Core 2.2 project to ASP.NET Core 3.0.
ms.author: tdykstra
ms.custom: mvc
ms.date: 08/05/2019
ms.date: 08/17/2019
uid: migration/22-to-30
---
# Migrate from ASP.NET Core 2.2 to 3.0
@ -165,6 +165,7 @@ 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.
The following is an example of `Startup.Configure` in a typical ASP.NET Core 2.2 app: