I have a project which made by asp.net core 2.1, and now I wanna to migrate to the 2.2 version.
I installed the SDK of 2.2 and changed the target framework to 2.2 in properties of the project.
After I clean&rebuild the solution, there are some warnings here I can not clean it:
1.
2.
3.
I found a tutorial about this which provided by Microsoft:
https://docs.microsoft.com/en-us/aspnet/core/migration/21-to-22?view=aspnetcore-2.2&tabs=visual-studio
I tried but still no work.
I think updating the new version SDK is easier like the .net framework by just changes the target framework in properties of the project. However, it seems not.
I wonder if there have an official tool which to update the .net core SDK from 2.1 to 2.2. Or I'd better create a brand new 2.2 project as well as paste all the file into it rather than fix the troublesome warnings.
Thank you.
Upgrading packages If you're using Visual Studio (or Rider), right-click on your Solution and click Manage nuget packages . Specifically, we're interested in packages which have an update available.
NET Core 2.1 will be reaching end of support on August 21, 2021 and after this date we will no longer provide updates including security fixes, or technical support for this version. We strongly recommend you migrate your applications to . NET Core 3.1 or later before this date.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With