At the end of the previous article ASP. NET Core Run error Http error 502.5 workaround, it is mentioned that the most recommended upgrade is to upgrade from 2.0 to version 2.1X.
Operation is as follows
The project example uses Https://github.com/52ABP/52ABP.School directly as an object, after all, he happens to be the version of. NET CORE 2.0.
The first thing to download is the SDK package.
Address: Https://www.microsoft.com/net/download
Download the latest version of. NET Core 2.1.
After opening the LTM.School
project, right-click the project to locate the LTM.School.csproj file and change the target framework in the file tonetcoreapp2.1
After modification:
<TargetFramework>netcoreapp2.1</TargetFramework>
The corresponding reference to the package packages is then modified.
Before modification
<ItemGroup> <PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.3" /> <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.0.1" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.0.1" /> <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.0.0" /> </ItemGroup>
Currently according to Microsoft's update strategy, when upgrading, you can already upgrade directly from it to 2.1.3.
We need to modify it to:
<ItemGroup> <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.1.1" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.1.1" /> <PackageReference Include="Microsoft.AspNetCore" Version="2.1.2" /> <PackageReference Include="Microsoft.AspNetCore.CookiePolicy" Version="2.1.1" /> <PackageReference Include="Microsoft.AspNetCore.HttpsPolicy" Version="2.1.1" /> <PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.1.1" /> <PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.1.1" /> <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.1.1" /> </ItemGroup>
Then close and save the LTM.School.csproj
project file.
This time can be F6 build solution, whether error. Generally, there is no error.
Preview URL
The upgraded Web site is now deployed to the
Http://school.yoyocms.com
Under the domain name, you can access it freely.
After upgrading to. NET CORE 2.1, speed is really a leverage.
About its performance can be seen
https://blogs.msdn.microsoft.com/dotnet/2018/04/18/performance-improvements-in-net-core-2-1/
Follow the public number: white Blackboard newspaper in the corner
Upgrading an ASP. NET Core 2.0 project to ASP. NET Core 2.1.3X