Update 3.1-to-5.0 migration guide for Preview 7 (#19288)
* Update 3.1-to-5.0 migration guide for Preview 7 * Update package refs sectionpull/19289/head
parent
bc445b457c
commit
dfa5534bc6
|
@ -4,7 +4,7 @@ author: scottaddie
|
|||
description: Learn how to migrate an ASP.NET Core 3.1 project to ASP.NET Core 5.0.
|
||||
ms.author: scaddie
|
||||
ms.custom: mvc
|
||||
ms.date: 06/11/2020
|
||||
ms.date: 07/22/2020
|
||||
no-loc: [Blazor, "Blazor Server", "Blazor WebAssembly", "Identity", "Let's Encrypt", Razor, SignalR]
|
||||
uid: migration/31-to-50
|
||||
---
|
||||
|
@ -41,14 +41,14 @@ If you rely upon a [global.json](/dotnet/core/tools/global-json) file to target
|
|||
{
|
||||
"sdk": {
|
||||
- "version": "3.1.200"
|
||||
+ "version": "5.0.100-preview.6.20318.15"
|
||||
+ "version": "5.0.100-preview.7.20366.6"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Update the target framework
|
||||
|
||||
In the project file, update the [Target Framework Moniker (TFM)](/dotnet/standard/frameworks) to `net5.0`:
|
||||
If updating a Blazor WebAssembly project, skip to the [Update Blazor WebAssembly projects](#update-blazor-webassembly-projects) section. For any other ASP.NET Core project type, update the project file's [Target Framework Moniker (TFM)](/dotnet/standard/frameworks) to `net5.0`:
|
||||
|
||||
```diff
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
@ -61,16 +61,43 @@ In the project file, update the [Target Framework Moniker (TFM)](/dotnet/standar
|
|||
</Project>
|
||||
```
|
||||
|
||||
## Update Blazor WebAssembly projects
|
||||
|
||||
For Blazor WebAssembly projects, apply the following changes in the project file:
|
||||
|
||||
1. Update the following properties:
|
||||
|
||||
```diff
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
- <TargetFramework>netstandard2.1</TargetFramework>
|
||||
- <RazorLangVersion>3.0</RazorLangVersion>
|
||||
+ <TargetFramework>net5.0</TargetFramework>
|
||||
+ <RuntimeIdentifier>browser-wasm</RuntimeIdentifier>
|
||||
+ <UseBlazorWebAssembly>true</UseBlazorWebAssembly>
|
||||
</PropertyGroup>
|
||||
```
|
||||
|
||||
1. Remove the package reference to [Microsoft.AspNetCore.Components.WebAssembly.Build](https://www.nuget.org/packages/Microsoft.AspNetCore.Components.WebAssembly.Build):
|
||||
|
||||
```diff
|
||||
<ItemGroup>
|
||||
- <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Build" Version="3.2.1" PrivateAssets="all" />
|
||||
```
|
||||
|
||||
## Update package references
|
||||
|
||||
In the project file, update each `Microsoft.AspNetCore.*` and `Microsoft.Extensions.*` package reference's `Version` attribute to 5.0.0 or later. For example:
|
||||
In the project file, update each [Microsoft.AspNetCore.*](https://www.nuget.org/packages?q=Microsoft.AspNetCore.*), [Microsoft.Extensions.*](https://www.nuget.org/packages?q=Microsoft.Extensions.*), and [System.Net.Http.Json](https://www.nuget.org/packages/System.Net.Http.Json) package reference's `Version` attribute to 5.0.0 or later. For example:
|
||||
|
||||
```diff
|
||||
<ItemGroup>
|
||||
- <PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.2" />
|
||||
- <PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="3.1.2" />
|
||||
+ <PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="5.0.0-preview.6.20312.15" />
|
||||
+ <PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="5.0.0-preview.6.20305.6" />
|
||||
- <PackageReference Include="Microsoft.AspNetCore.JsonPatch" Version="3.1.6" />
|
||||
- <PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="3.1.6" />
|
||||
- <PackageReference Include="System.Net.Http.Json" Version="3.2.1" />
|
||||
+ <PackageReference Include="Microsoft.AspNetCore.JsonPatch" Version="5.0.0-preview.7.20365.19" />
|
||||
+ <PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="5.0.0-preview.7.20364.11" />
|
||||
+ <PackageReference Include="System.Net.Http.Json" Version="5.0.0-preview.7.20364.11" />
|
||||
</ItemGroup>
|
||||
```
|
||||
|
||||
|
|
Loading…
Reference in New Issue