AWS Porting Assistant for .Net
Migration from .Net to .Net Core
Many organizations built their solutions (web pages, web forms, web services, web sockets, etc.) using .Net Framework. I personally have built many solutions using .Net Framework as well. With the introduction of .Net Core back in 2016, there are many beneficial reasons to start migrating to .Net Core and this has been the trend for a lot of the customers I have been working with.
What are the benefits?
From a high level, the benefits of moving to .Net Cores are:
- Cross-Platform (Windows, macOS, and Linux)
- Microservices architecture
- Docker containerized solution
- High-performance and scalable systems
- Open Source
- It is still C#
I won't go into the details for each of these benefits because you can find plenty of related articles on the internet. Let's say you have done the research and is convinced that you should migrate to .Net core, the question is, what's next?
How to get started?
Early in July 2020, AWS released something called the Porting Assistant for .Net. It is an analysis tool that scans your .NET framework application and generates a .NET Core compatibility assessment. It helps to speed up the process of identifying the dependencies and APIs that are incompatible with .NET core.
Let's test it out
I will be using an API application that I have built with .NET Framework for this demo.
Step 1. Download the software via this link. (Note: this is for Windows Operating System only.) Install and launch the application. You should be able to see the application homepage launched in an application like this:
Step 2. Click "Get started".
Step 3. You can select your profile if you already have one. Otherwise, you can create a new profile right now. Your account's access key and secret assess key will be required. Once you have completed your profile, click "Next".
Step 4. Select the .sln file from your project, in my case, it is token.sln. Click "Assess".
Step 5. The assessment task will run and you can see the status on the top left-hand corner.
Step 6. Once it is completed, you will see the status has changed. You can now click on your project to start exploring.
Step 7. The main page will show a summary of the number of NuGet packages and APIs that are incompatible. Click on the NuGet packages tab to find out which specific packages are incompatible.
Step 8. Next, let's go over the list for APIs as well.
Step 9. Lastly, you can view the list of incompatible source files under the Sources files tab.
Exporting and porting functionality
This application has the functionality to export assessment reports into csv formatted files. This is particularly handy when you are trying to discuss or review the actual migration because it eliminates the hassle of having to open this app and reassess the solution each time.
You can also start porting your project by clicking the "Port Project" button and the application will show you a list of libraries in your environment that can be upgraded. Click "Port", the application will now create the new .csproj with the dependencies added to it.
Wrap up
As you can see, this application is easy to install and use. It provides a good starting point for developers/tech leads to build out the "tasks" that will be needed in order to port the necessary libraries to .NET core.
Key takeaways and Food for thoughts
- This application (.exe) can only be run in Windows OS.
- You will need to know your access key ID and secret assess key in order to use this application.
- This tool is free!
- If you have incompatible libraries, the porting task may not work properly.
- Some porting/migration tasks can be quite complicated such as my example shown above. In this case, the .net MVC will need to be ported, while numerous design considerations and code changes will be required.
- There's also another key component that needs to be migrated, which is ASP.NET Membership authentication to ASP.NET Identity. Here is a step by step work through to tackle this migration. Follow the steps and you should be able to port it over.
- The process of modernization/breaking up the monolithic app should not happen in a big bang fashion. Instead, you should consider moving different pieces one at a time to ensure everything is working as expected and the solution is loosely coupled.