How can I migrate from ASP.NET Core 2.1 to 2.2 easily?

The schema errors may be an indicator that you are using an outdated Visual Studio 2017 edition.

To use .NET Core 2.2 you need to update to the latest Visual Studio 2017.9 (15.9).

Prerequisites for .NET Core on Windows:

To verify your Visual Studio version:

  • On the Help menu, choose About Microsoft Visual Studio.
  • In the About Microsoft Visual Studio dialog, verify the version number.
    • For .NET Core 3.0 Preview 1 apps, Visual Studio 2019 Preview 1 or higher.
    • For .NET Core 2.2 apps, Visual Studio 2017 version 15.9 or higher.
    • For .NET Core 2.1 apps, Visual Studio 2017 version 15.7 or higher.
    • For .NET Core 1.x apps, Visual Studio 2017 version 15.0 or higher.

Okay, so I found an easier solution than to renew the entire project. What I did was

Made sure those two lines exist in my project file.

 <PropertyGroup>
    <TargetFramework>netcoreapp2.2</TargetFramework>
    <RuntimeFrameworkVersion>2.2.0</RuntimeFrameworkVersion>
  </PropertyGroup>

Then I had errors saying that some of the packages were not compatible, so I changed the versions of those as well. It was those two specifically:

 <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
    <PackageReference Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="2.2.0" />
  </ItemGroup>

After that everything compiled successfully without warnings.


Finally, I used the most stupid way that creates a brand new empty .net core 2.2 project and pastes most of the old project file(including the model/controllers/view/stylesheet/javascript but except the csproj/Properties)to it.

Then clear the solution and rebuild, all warning clear.

This way is so rude and unprofessional, but maybe is the easiest way to do it.