DEV Community

Sonia Mathias
Sonia Mathias

Posted on

.NET Core vs .NET Framework

The debate between choosing the .NET Core and .NET Framework for developing applications is still evident in the tech domain. While the choice between .NET Core and the .NET Framework is largely determined by the type of application to be developed and the platform on which it will be developed, there are other aspects to consider before selecting a framework for your next web development project.

.NET is a broad term as Microsoft supports both the .NET Core and .NET Framework frameworks. While the .NET Framework is the older and more traditional version, .NET Core has entered the tech domain to solve its shortcomings and keep up with technological advancements. However, this does not imply that the .NET Framework is losing its popularity.

.NET and .NET Core are widely used software development frameworks, making them a robust choice for your upcoming application project.

This article comprehensively explains the .NET Core and the .NET Framework. You'll gain valuable insights about the two frameworks as well as understand the differences between them. The key things discussed in this blog include:

  • The .NET Environment
  • Understanding .NET Core and the .NET Framework
  • Major differences between the frameworks
  • Which framework is better?
  • Conclusion

The .NET Environment:

.NET is a free, open source developer platform for developing various types of applications. You can build web, mobile, gaming, IoT, and desktop applications with .NET by using multiple languages like C#, F#, or Visual Basic, as well as libraries, and editors.

C# is a type-safe, simple, modern, object-oriented programming language.
F# is convenient to develop code that is concise, reliable, and performant.
Visual Basic is a user-friendly language with a simple syntax for creating type-safe, object-oriented applications.

The .NET development framework supports two major platforms for developing applications. They are the .NET Framework, which has been around for the last two decades, and .NET Core. However, there are a cumulative of three major .NET ecosystem components: .NET Core, .NET Framework, and Xamarin.

But Xamarin isn't involved in this discussion. If you want to create any mobile app, you can opt for Xamarin. It is compatible with the iOS, Android, or Windows' Mobile app.

Understanding .NET Framework and .NET Core

.NET framework:

The .NET framework was first introduced in 2002. Microsoft intended for it to be the only single framework that would govern all programming languages. However, while .NET allowed developers to use over 60 programming languages (only 11 of which were developed by Microsoft), it was only available for Windows.
Many developers, however, did not consider it a sticking point. Indeed, Microsoft has continued to improve the .NET framework. As a result, even with the launch of Silverlight and Xamarin, developers still continued to use .NET. However, when extending the compatibility of .NET to other platforms, portability concerns became more prevalent.

Regardless of these transmutations to the framework, a genuine cross-platform ecosystem remained amorphous. .NET Core was born as a result of this.

.NET Core:

Finally, in 2014, Microsoft decided to start working on a .NET reboot. In 2016, they released .NET Core, which was created primarily to facilitate cross-platform runtimes.
It is the most recent version of Microsoft's .NET Framework. It's a free, open-source, and permutable design platform for software systems that provides support for code libraries and numerous scripting languages. It's a multi-platform framework that is compatible with Windows, Mac OS, and Linux. Online, cloud, IoT, microservices, machine learning, games, and more can all be built using the .NET Core Framework. It is modular, lightweight, and an agile framework that was built from the ground up.

*The Top 10 Major Differences Between .NET Core and .NET Framework
*

Differentiating Factors .NET Core .NET Framework
Open Source .NET Core is a totally open-source platform. The .NET Framework only has a particular number of open source components.
Installation As .NET Core is a cross-platform compatible with various operating systems, it needs to be installed independently. .NET Framework is installed as a single package and runtime ecosystem for Windows.
Application Models .NET Core’s application model comprises the ASP.NET and Windows apps. .NET Framework’s application model comprises Windows Presentation Foundation (WPF), ASP.NET, and Base Class Library (BCL).
Compatibility .NET Core is compatible with multiple operating systems, including Windows, Mac OS, and Linux. On the flip side, .NET Framework is compatible only with the Windows OS.
Performance .NET Core renders high performance and scalability relative to .NET Framework due to its architecture. .NET Framework is less efficient as opposed to .NET Core with respect to performance and scalability of applications.
Security .NET Core does not have the feature of Code Access Security. .NET Framework has the feature of Code Access Security, and hence is better than .NET Core in this regard.
Deployment Model During the installation of a new version of .NET Core, it is updated promptly on one computer at a time, consequently creating new directories/folders in the existing program without affecting it. Hence, .NET Core has a robust and resilient deployment model. As far as the .NET Framework is concerned, when the updated version is released, it is initially deployed only on the Internet Information Server.
Microservices and REST Services Support .NET Core supports the development and running of microservices, but the user has to build a REST API for its implementation. .NET Framework lacks the development and implementation support for microservices, but it does support the REST API services.
Versatility .NET Core supports open-source mobile application platforms, like Xamarin, through the .NET Standard Library. Developers leverage Xamarin’s tools to build mobile apps for certain mobile devices like iOS, Android, and Windows phones. On the contrary, .NET Framework is not suitable for mobile application development.
Packaging and Shipping .NET Core is shipped as a cluster of Nugget packages. .NET Framework’s libraries are packaged and shipped together.
CLI Tools .NET Core offers light-weight editors and Command Line Interface tools for all platforms. You can also pivot to IDE, if you need them. .Net Framework is heavy for the CLI, which makes developers prefer lightweight Command Line Interface.

*Which framework should you use? *

The short answer is, ‘It depends.’ It depends on the type of application you are looking to develop and which platform would be best to meet the requirements of the project.

Use .NET Core when:

  1. Using microservices, as .NET Core is lightweight, enables a combination of tools, and can be minimised microservices.
  2. Performance and scalability are top priorities for you. In such situations, Microsoft suggests running .NET Core with ASP.NET Core.
  3. You need to run applications that need several versions of .NET simultaneously.

Use .NET Framework when:

  1. Your applications are compatible with Windows only.
  2. The developed applications run only on .NET Framework.
  3. Applications need tools that are not provided by .NET Core.

Final Thoughts:

At this point, we’re sure that you should have understood the distinctions between .NET Core and .NET Framework. In basic terms, .NET Core is the most recent version of Microsoft's .NET Framework, It is an open-source, free, and widely used development platform. It is compatible with Windows, Mac OS, and Linux. The .NET Core Framework might be used to create an assortment of applications. Whereas, Microsoft's .Net Framework is a software programming platform for developing and running Windows applications. .Net Framework encompasses programming languages, developer tools, and libraries that are used to build desktop and web applications. It is likewise used to develop games, websites, and other online solutions.

Top comments (4)

Collapse
 
jayjeckel profile image
Jay Jeckel

There is basically no reason to choose .Net Framework for a new project. There are a few reasons one may have to use .Net Framework, but unless the choice is forced, then one should always choose .Net Core. Even if you're only planning on supporting Windows OS. Even if you're making a library that has to be used by .Net Framework applications, one should still use .Net Core to create the library as .Net Core libraries that target .Net Standard 2.0 can be used by .Net Framework projects.

Or in shorter words: .Net Framework is dead, all new projects should target .Net Standard 2.0, .Net Standard 2.1, .Net 5, or .Net 6.

Collapse
 
jakecarpenter profile image
Jake Carpenter

It is also worth noting that no future .NET Standard versions will be "released." So build new .NET 6+ libraries to target .NET Standard support as needed until consuming code can be upgraded to match and we can rid ourselves of that mess once and for all.

Collapse
 
curiousdev profile image
CuriousDev

This is also what I think (after what I read or heard). Do you know, why .NET Framework is limited to Windows?

Collapse
 
jayjeckel profile image
Jay Jeckel

Sure. The Microsoft official runtime for .Net Framework was only written to work on windows, relying heavily on Windows' underlying Win32 api. It was unofficially possible to run .Net Framework code on Linux using the Mono project's Linux runtime and that was the foundation Microsoft used to create the cross-platform .Net Core.