The evolution of microservices greatly impacted how we think, write and manage applications in the cloud environment.
The existing monoliths are being migrated slowly to implement microservices and their patterns.
Scalability is one of the major aspects that developers/architects looking for migrating from ASP.NET Framework to ASP.NET Core.
I was reading the ASP.NET Core in Action, 3rd Edition, and found this chapter interesting on migrating existing asp.net applications to asp.net core. So, this blog post is about migrating.
In this post, we’ll see
But, there are benefits of asp.net core that come along with migrating existing asp.net applications such as
However, converting the existing asp.net applications may involve additional cost and technical expertise to do that transition.
There are difficulties converting the following applications to asp.net core
Let’s see why it is difficult to transition the above use cases
If the application is asp.net web forms, trying to convert it is not advisable as web forms are tied to System.Web.dll and IIS.
The conversion involves a complete rewrite of the app in ASP.NET Core.
It doesn’t mean your hopes of converting are dead at this point. There is a community-driven repository that guides on how to reuse much of the markup as in blazor.
Blazor server provides a component-based application that is similar to the web forms application model. So, you can convert web forms application gradually to asp.net core blazor application.
You can slowly transition the APIs into asp.net core web API application by reducing the reliance on the web forms concepts like ViewData.
Windows Communication Foundation (WCF) is partially supported in ASP.NET Core. Again, it’s possible to build using the libraries for both the WCF client side (part of the .NET foundation) and the server-side (supported by the .Net foundation).
However, the above-mentioned libraries don’t support all of the APIs available in the .NET framework WCF. If you need all of them for sure, don’t migrate to ASP.NET Core for now.
If an MVC application is complex and uses the extensive features of MVC like message handlers, then porting to ASP.NET Core will be more difficult.
Although ASP.NET Core is built with similar features as MVC, the underlying architecture is different as ASP.NET Core is written from scratch.
If the existing application will need significant future development, then migrating to ASP.NET Core is a good choice.
If your application is rarely used and may not involve additional development efforts, then it’s better not to migrate to an ASP.NET Core application.
Microsoft will support .NET Framework for years to come (you may have to update the framework) though we have a new release of ASP.NET Core 7.
The best approach to migrating an ASP.NET core project is to start small and integrate with an existing application or start your new project as ASP.NET Core and integrate with an existing monolith.
It’s best to work in chunks rather than converting the entire application at once and Microsoft also provides YARP (a reverse proxy for .NET) and also ASP.NET Migration Tooling in Visual Studio to help implement the strangler fig pattern.
In the early migration, we see only a small portion of the modern application created in early migration and gradually most of the legacy system is migrated to the modern and then once the migration is complete we should have everything in the modern system.
ASP.NET Core applications offer modularity and performance at the same time. And they are best suited for microservices in the .NET ecosystem.
If your existing business is built on ASP.NET Framework and is working well and getting fruits for you then you don’t need to migrate to ASP.NET core.
Converting existing applications to asp.net core is possible but it involves planning, time, effort, and resources.
But, understanding the hard parts of the existing application is critical to transforming to an ASP.NET Core application. It helps to think about what it takes to convert the hard parts of the application first.
If you are creating a new product and the product really doesn’t need to be scalable for a huge number of users, you may not need to do it in ASP.NET Core. But, I’d recommend creating applications in ASP.NET Core now because .NET Framework may eventually retire sometime in the future and you may have to look up for ASP.NET Core again.
This article is sourced from a chapter in ASP.NET Core In Action, 3rd Edition written by Andrew Lock.
Andrew lock also gives a great insight into how the ASP.NET Core works and how it processes a request and many great things we can do with ASP.NET Core. It’s worth a read.
The first three users to utilize the below coupons will get a free eBook version of ASP.NET Core In Action, 3rd Edition by Andrew Lock. Here are the coupon codes
Also, get 35% off on all books with this coupon code: blrethinked22
Disclaimer:
This post contains affiliate links.
Karthik is a passionate Full Stack developer working primarily on .NET Core, microservices, distributed systems, VUE and JavaScript. He also loves NBA basketball so you might find some NBA examples in his posts and he owns this blog.
In this post, we’ll see how to test gRPC Server applications using different clients. And… Read More
In this post, we'll create a new gRPC project in ASP.NET Core and see what's… Read More
In this blog post, we’ll see how to run dotnet core projects without opening visual… Read More
Programmatically evaluating policies is useful when we want to provide access or hide some data… Read More
We saw how we could set up policy-based authorization in our previous article. In this… Read More
What is policy-based authorization and how to set up policy-based authorization with handlers and policies… Read More
This website uses cookies.