Upgrading NetCore from v1.1.0 to v2.0.0 in Visual Studio 2017

Note:

Any time if you see "Package restore failed. Rolling back package changes", please seelct Tools/Options: NuGet Package Manager/General/Clear All NuGet Cache(s)


Select Project / Manage Nuget Packages

Step 1 Update.csproj


Change
    <TargetFramework>netcoreapp1.1</TargetFramework>
To:
    <TargetFramework>netcoreapp2.0</TargetFramework>


Note: if this is not changed, you'll receive error

"Package restore failed. Rolling back package changes"


Step 2 Update all installed packages

In NuGet Package Manager, select Updates tab, select All package and click Update

Step 3 Install-Package Microsoft.EntityFrameworkCore.SqlServer


See https://docs.microsoft.com/en-us/ef/core/


After done, all packages references in .csproj will be automatically updated to v2.0


For all other errors, please refer to the following must reading sites:

https://docs.microsoft.com/en-us/aspnet/core/migration/1x-to-2x/
https://developercommunity.visualstudio.com/content/problem/92979/some-aspnet-core-projects-fail-to-add-the-applicat.html

Comments

Popular posts from this blog

Use GnuPG Tools or C# Code for PGP Encryption and Signature

Errors in Net Core Add-Migration

Confusing Concepts about SFTP: SSH2 vs OpenSSH