Upgrading an ASP. NET Core 2.0 project to ASP. NET Core 2.1.3X

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.