Reader small image

You're reading from  C# 7 and .NET Core 2.0 High Performance

Product typeBook
Published inApr 2018
Reading LevelBeginner
Publisher
ISBN-139781788470049
Edition1st Edition
Languages
Right arrow
Author (1)
Ovais Mehboob Ahmed Khan
Ovais Mehboob Ahmed Khan
author image
Ovais Mehboob Ahmed Khan

Ovais Mehboob Ahmed Khan is a seasoned programmer and solution architect with nearly 20 years of experience in software development, consultancy, and solution architecture. He has worked with various clients across the world and is currently working as a senior customer engineer at Microsoft. He specializes mainly in application development using .NET and OSS technologies, Microsoft Azure, and DevOps. He is a prolific writer who has written several books and articles on various technologies. He really enjoys talking about technology and has given a number of technical sessions around the world.
Read more about Ovais Mehboob Ahmed Khan

Right arrow

Upgrading path from .NET Core 1.x to 2.0

.NET Core 2.0 comes with lots of improvements, and this is the primary reason people wanted to migrate their existing .NET Core applications from 1.x to 2.0. However, there is a checklist which we will go through in this topic to ensure smooth migration.

1. Install .NET Core 2.0

First of all, install the .NET Core 2.0 SDK on your machine. It will install the latest assemblies to your machine, which will help you to execute further steps.

2. Upgrade TargetFramework

This is the most important step, and this is where the different versions need to be upgraded in the .NET Core project file. Since we know that, with the .csproj type, we don't have project.json, to modify the framework and other dependencies, we can edit the existing project using any Visual Studio editor and modify the XML.

The XML Node that needs to be changed is the TargetFramework. For .NET Core 2.0, we have to change the TargetFramework moniker to netcoreapp2.0, which is shown as follows:

<TargetFramework>netcoreapp2.0</TargetFramework>

Next, you can start building the project which will upgrade the .NET Core dependencies to 2.0. However, there is a chance of a few of them still referencing the older version, and upgrading those dependencies needs to be done explicitly using NuGet package manager.

3. Update .NET Core SDK version

If you have global.json added to your project, you have to update the SDK version to 2.0.0, which is shown as follows:

{ 
  "sdk": { 
    "version": "2.0.0" 
  } 
} 

4. Update .NET Core CLI

.NET Core CLI is also an important section in your .NET Core project file. When migrating, you have to upgrade the version of DotNetCliToolReference to 2.0.0, which is shown as follows:

<ItemGroup> 
  <DotNetCliToolReference Include=
"Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.0" /> </ItemGroup>

There might be more tools added depending on whether you are using Entity Framework Core, User Secrets, and others. You have to update their versions.

Changes in ASP.NET Core Identity

Previous PageNext Page
You have been reading a chapter from
C# 7 and .NET Core 2.0 High Performance
Published in: Apr 2018Publisher: ISBN-13: 9781788470049
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Ovais Mehboob Ahmed Khan

Ovais Mehboob Ahmed Khan is a seasoned programmer and solution architect with nearly 20 years of experience in software development, consultancy, and solution architecture. He has worked with various clients across the world and is currently working as a senior customer engineer at Microsoft. He specializes mainly in application development using .NET and OSS technologies, Microsoft Azure, and DevOps. He is a prolific writer who has written several books and articles on various technologies. He really enjoys talking about technology and has given a number of technical sessions around the world.
Read more about Ovais Mehboob Ahmed Khan