Share:
- .Net now supports single file applications that don’t necessitate for .Net to be on your machine. Now you can compile .Net in your application and get a small single file that you can copy to any machine.
- One .Net means one SDK for mobile, web, desktop, and console.
- Native support for ARM64 in .Net core
- Smaller containers than ever before
- Cross-platform Native UI
Migration Plan
As with any migration plan, first and foremost you need to be aware of everything that is not making it to the upgraded version. Earlier Core 2.0 borrowed some technologies from the .Net framework, that’s not the case with newer versions. Rather some things may be skipped in the new version for some technological reason or the other.- AssemblyLoadContext is replacing app domains, as the latter is quite an expensive runtime feature and not suitable for modern app development.
- Remoting is being replaced by named pipes and gRPC
- WebForms is being replaced by ASP.Net Blazor
- WCF Server is being replaced by gRPC and Open source CoreWCF
- WF is being replaced by Open source Corewf
How to Migrate your project to .Net 5
1. Ask if and why you need to migrate
The first step in migration is to understand the feasibility and goals for migration. No need to be over aggressive with the migration because .Net is not going anywhere. If you’re happy with how things are, then there is no need to migrate as .Net is part of Windows and is bound to get fixes for a considerably long period. On the other hand, if you want to innovate and leverage new features and technologies then .Net 5 is the way forward. Your migration approach will also depend on your choice of Operating System. If you’re sticking with the existing one or shifting to another. Pro Tip: Ensure that you have backups along the way so you can still ship working software. It’s futile to port in a big one-off migration. While it might work for small projects, not so much as your projects get bigger.2. Analyze your app
Having worked months, even years on an app, one might think that they know the app inside out. It might be true for simple apps but in the case of complex projects, it’s easy to overlook obsolete things that might add to the difficulty of an already grueling undertaking. Things to keep in mind while auditing your app:- Use ApiPort to list outcode and its dependencies.
- Legacy code can be a pain to carry forward. Analyze legacy code for feasibility if it seems obsolete and expensive to refactor then consider dropping before the port.
- Analyze dependencies and ensure they have support for .net 5. If they are not supported then consider moving to modern alternatives before porting.
3. Convert Project
After understanding the needs for the port and deciding to ahead with it, you’ll need to convert your project. Conversion typically involves:- Replace packages.config with<packageReference> elements in the project
- Another option would be to use Try-Convert to automate the process to migrate the project files to SDK style
- It can’t convert some project types like ASP.NET and Xamarin
- It doesn’t migrate any source code (*.cs), only project files(*.csproj)