Upgrading Existing .NET Apps to .NET 5

  • Choosing the migration approach
  • Points to ponder regarding an as-is upgrade

Choosing the migration approach

  • The size and footprint of the solution
  • The number of different technologies that comprise the solution (for example, desktop apps, web apps, and REST APIs)
  • Whether an unsupported technology (such as WCF Server) or .NET runtime feature (such as .NET Remoting) is used

Lift and shift versus architectural transformation

Replacing third-party libraries with platform-provided features

Points to ponder regarding an as-is upgrade

Unsupported technologies

Unsupported Windows OS-specific features

Transforming application configuration

<appSettings>
<add key=”MaximumRowsPerPage” value=”10" />
</appSettings>
  • Support for hierarchical plain old CLR object (POCO)-based settings
  • Built-in binding and validation for non-string values, such as int, bool, and decimal
  • Uniform handling and choices of configuration store, such as JSON files, XML files, in-memory objects, command-line arguments, and environment variables
  • Support for encrypted and cloud-specific stores, such as Azure Key Vault or Azure App Configuration

Choosing the Entity Framework version

Using .NET Framework compatibility

Upgrading third-party NuGet packages

  • If the current NuGet package version is .NET 5- or .NET Standard 2.1-compatible, then use that version.
  • If the current version does not support .NET 5/.NET Standard 2.1, but the later NuGet package version does, it’s likely a good candidate to be used. We need to review any breaking changes in the new version to assess the code refactoring effort required to use the new version.
  • The vast majority of active and popular NuGet packages fall under the first two cases. However, if there is no compatible version, then it is possible to use the .NET Framework library from .NET Standard code using the compatibility mode as described in the preceding section.
  • Another option is to use an alternative library, but this could potentially take significant time and cost to implement.

Summary

Further reading

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Packt

Packt

We help developers build better software | Email customercare@packtpub.com for support | Twitter support 9-5 Mon-Fri