When to use .NET Core and When to use .NET Framework
Nowadays we can see there is a lot of discussions which to use when either .NET Core or .NET framework, which one is good for me. So we thought to write about this so that it will provide a clear picture to developers and decision makers. When to use .NET Core and When to use .NET Framework.
What is .NET Core?
.NET Core is an open-source general-purpose development platform maintained by Microsoft and the .NET community on GitHub. It's cross-platform, supporting Windows, macOS, and Linux, and can be used in the device, cloud, and IoT applications.
.NET Core refers to several technologies including .NET Core, ASP.NET Core and Entity Framework Core. These technologies are different than native .NET in that they run using CoreCLR runtime (used in Universal Windows Platform).
What is the .NET Framework?
NET Framework is a software framework developed by Microsoft that runs primarily on Microsoft Windows. It includes a large class library named Framework Class Library and provides language interoperability across several programming languages.
So with these definitions, I think it is more clear when we can use .NET core and .NET framework, but some cases are listed below which will help us to choose as per our need too.
Use .NET Core for server application when:
- Cross-platform needs.
- Targeting microservices.
- Use Docker containers.
- Need to build Machine learning application with your C#, F# knowledge
- Need for high-performance and scalable systems.
- The need of side-by-side .NET versions per application.
Use the .NET Framework for server application when:
- If Your application currently uses .NET Framework (recommendation is to extend instead of migrating).
- If Your application uses third-party .NET libraries or NuGet packages not available for .NET Core.
- If Your application uses .NET technologies that are not available for .NET Core.
- If Your application uses a platform that doesn’t support .NET Core.
Now when to use ASP.NET and when to use ASP.NET Core
- Use ASP.NET When you need to,
- Build for Windows
- Have to Use Web Forms, SignalR, MVC, Web API, WebHooks, or Web Pages
- One version per machine
- Develop with Visual Studio using C#, VB, or F#
- Good performance
- Use .NET Framework runtime
Use ASP.NET Core when you need to,
- Build for Windows, macOS, or Linux
- Razor Pages is the recommended approach to create a Web UI as of ASP.NET Core 2.x. See also MVC, Web API, and SignalR.
- Multiple versions per machine
- Develop with Visual Studio, Visual Studio for Mac, or Visual Studio Code using C# or F#
- Higher performance than ASP.NET
- Choose .NET Framework or .NET Core runtime
Though the above points are true technically some time selection of framework or technology also depend on team expertise and willingness of the team to accept the new challenges. Both .NET Core and .NET framework applications can run with supper performance if coded expertly and smartly.