ASP.NET is a popular web-development framework for building web apps on the .NET platform. There are two supported implementations for building server-side applications with .NET: .NET Framework and .NET Core. This blog is our takeaway from a Microsoft article (link provided at the bottom of this blog) and will provide guidance on when to choose .NET Core over the .NET framework option, based on the business goals you want to accomplish. The latest version of .NET Core is 3.0 Preview.
Choosing .Net Core over .Net Framework
ASP.NET Core is the open-source version of ASP.NET, which can run on macOS, Linux, and Windows. ASP.NET Core is a cross-platform framework developed by both Microsoft and its community.
.Net Core and .Net Framework both share many of the same components and you can share code across the two, however your choice of implementation can be determined by the points listed below.
Use .NET Core for your server application when:
- You have cross-platform needs.
When your web application/service needs to run on multiple platforms like Windows, macOS and Linux. .Net Core supports the above operating systems as their workstation. Visual Studio provides IDE for Windows and macOS. Visual Studio Code supports .NET Core with IntelliSense and Debugging. Other third party editors – Sublime, Emacs, VI, work with .Net Core. - You are targeting microservices.
A microservices architecture provides the ability to mix technologies across a service boundary, e.g. you can mix microservices or services developed with .Net Framework, Java, Ruby or other monolithic technologies. - You are using Docker containers.
Containers are commonly used in conjunction with a microservices architecture. Containers can also be used to containerize web apps or services that follow any architectural pattern. .NET Framework can be used on Windows containers, but the modularity and lightweight nature of .NET Core makes it a better choice for containers. When creating and deploying a container, the size of its image is much smaller with .NET Core than with .NET Framework. Because it is cross-platform, you can deploy server apps to Linux Docker containers. - You need high-performance and scalable systems.
When your system needs the best possible performance and scalability, .NET Core and ASP.NET Core are your best options. High-performance server runtime for Windows Server and Linux makes .NET a top performing web framework on TechEmpower benchmarks. Performance and scalability are especially relevant for microservices architectures, where hundreds of microservices may be running. With ASP.NET Core, systems run with a much lower number of servers/Virtual Machines (VM). The reduced servers/VMs save costs in infrastructure and hosting.
Data sourced from official tests available at TechEmpower Round 16.
- You need side-by-side .NET versions per application.
To install applications with dependencies on different versions of .NET, we recommend .NET Core. .NET Core offers side-by-side installation of different versions of the .NET Core runtime on the same machine. This side-by-side installation allows multiple services on the same server, each of them on its own version of .NET Core. It also lowers risks and saves money in application upgrades and IT operations.
Stay with .NET Framework for your server application when:
- Your app currently uses .NET Framework (recommendation is not to migrate apps to .NET framework, but switch to .NET Core when extending an app).
- Your app uses third-party .NET libraries or NuGet packages not available for .NET Core.
- Your app uses .NET technologies that aren’t available for .NET Core.
- Your app uses a platform that doesn’t support .NET Core.
Conclusion
.NET Core provides a way of developing new generations of scalable enterprise server-side applications. With continuous improvements to its features, an ASP.NET developer’s life has become far easier, and the enterprises’ web presence more profitable, making ASP.NET Core the prime choice among enterprises to build their server-side apps. However, if your applications are already running under .NET Framework or need some components which are not supported by .Net Core, it is advisable to stay with .NET Framework.
- This blog summarizes the original Microsoft article