.NET Framework vs .NET Core vs .NET: Key Differences in C#
.NET Framework is the original Windows-only platform for building C# apps, .NET Core is a cross-platform, open-source, and faster version, and .NET (also called .NET 5+) unifies both into a single modern platform for all app types.Quick Comparison
Here is a quick side-by-side look at the main differences between .NET Framework, .NET Core, and .NET.
| Feature | .NET Framework | .NET Core | .NET (5 and later) |
|---|---|---|---|
| Platform Support | Windows only | Windows, macOS, Linux | Windows, macOS, Linux |
| Open Source | No | Yes | Yes |
| App Types | Desktop (WinForms, WPF), Web (ASP.NET) | Web, Console, Cloud, Microservices | All app types including Mobile and Cloud |
| Performance | Good but older | High performance and optimized | Improved performance over Core |
| Release Status | Legacy, no new features | Supported until .NET 5 | Current and future platform |
| API Surface | Large Windows-specific APIs | Smaller, modular APIs | Unified and expanded APIs |
Key Differences
.NET Framework is the original Microsoft platform released in early 2000s, designed only for Windows desktop and web apps. It includes a large set of Windows-specific APIs and supports technologies like WinForms and WPF for desktop apps. However, it is closed-source and no longer actively developed with new features.
.NET Core was introduced later as a cross-platform, open-source rewrite of .NET to support Windows, macOS, and Linux. It is modular, lightweight, and optimized for modern app needs like cloud and microservices. It supports console apps, ASP.NET Core web apps, and more, but initially lacked some desktop support.
.NET (starting with version 5) unifies .NET Framework and .NET Core into a single platform. It supports all app types including desktop, mobile, cloud, and IoT with improved performance and a consistent API. This is the future of .NET development, replacing both older platforms.
Code Comparison
Here is a simple C# program that prints a greeting, showing how you would write it in .NET Framework.
using System;
namespace HelloWorldApp
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello from .NET Framework!");
}
}
}.NET Core Equivalent
The same program in .NET Core looks almost identical, showing the shared C# language and runtime features.
using System; class Program { static void Main() { Console.WriteLine("Hello from .NET Core!"); } }
When to Use Which
Choose .NET Framework if you have existing Windows desktop apps using WinForms or WPF that rely on Windows-only APIs and you do not plan to migrate soon.
Choose .NET Core if you want cross-platform support and are building new web, cloud, or console apps but are not ready to move to the unified platform.
Choose .NET (5 or later) for all new projects to get the best performance, cross-platform support, and future-proof features across desktop, mobile, web, and cloud.