Improving your C# Skills
上QQ阅读APP看书,第一时间看更新

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.