Prerequisites to porting code

Make the needed changes to build and run a .NET application before beginning the work to port your code. These changes can be done while still building and running a .NET Framework application.

Upgrade to required tooling

Upgrade to a version of MSBuild/Visual Studio that supports the version of .NET you will be targeting. See Versioning relationship between the .NET SDK, MSBuild and VS for more info.

Update .NET Framework target version

We recommend that you target your .NET Framework app to version 4.7.2 or higher. This ensures the availability of the latest API alternatives for cases where .NET Standard doesn't support existing APIs.

For each of the projects you wish to port, do the following in Visual Studio:

  1. Right-click on the project and select Properties.
  2. In the Target Framework dropdown, select .NET Framework 4.7.2.
  3. Recompile the project.

Because your projects now target .NET Framework 4.7.2, use that version of the .NET Framework as your base for porting code.

Change to PackageReference format

Convert all references to the PackageReference format.

Convert to SDK style project format

Convert your projects to the SDK-style format.

Update dependencies

Update dependencies to their latest version available, and to .NET Standard version where possible.

Next steps