What Is New in .NET 5.0
.NET 5.0 unifies the .NET platform, bringing together .NET Core, .NET Framework, and Xamarin into a single base for modern development. This release focuses on performance, new language capabilities in C# 9, and expanded platform support.
| Category | Key Changes |
|---|---|
| Platform & Unification | Single, unified .NET 5.0 platform and runtime. Replaces .NET Standard for app-level code. |
| Languages | C# 9 and F# 5 with new features like records and top-level statements. |
| Performance | Major improvements in GC, System.Text.Json, and containers. |
| APIs & Libraries | New JSON APIs, enhanced regular expressions, and HTTP/2 support. |
| Application Types | Windows Desktop (WinForms, WPF), Web, Cloud, Mobile (via Xamarin), and more. |
How does .NET 5 unify the development platform?
.NET 5 merges the key branches of .NET into one base platform. You now use the same SDK, runtime, and libraries to build Windows desktop apps, web services, mobile apps with Xamarin, and cloud-native applications.
In practice, this means you can share code more easily across different application types. It also simplifies the long-term roadmap, as there's now one primary .NET going forward instead of multiple, sometimes divergent, frameworks.
What are the major performance wins in .NET 5?
Garbage Collection (GC) saw significant optimizations, reducing pause times and improving throughput. The System.Text.Json serializer got much faster for both serialization and deserialization, making it a strong contender for high-performance scenarios.
Containerized applications benefit from better memory management when running in environments with memory limits. The runtime is also more efficient overall, with countless small optimizations across the base class libraries that add up to substantial gains.
What new C# 9 features should I start using?
Records are the headline feature, providing a concise syntax for immutable reference types with built-in value-based equality. They're perfect for data-carrying objects like DTOs.
public record Person(string FirstName, string LastName);
Top-level statements simplify the program structure for small apps and scripts by removing boilerplate. Pattern matching enhancements and new relational patterns also make conditional logic more expressive and powerful.
What's new for building web and cloud apps?
ASP.NET Core in .NET 5 includes performance boosts and new features. HTTP/2 support is now fully enabled for gRPC services and HttpClient, improving communication efficiency for microservices.
For cloud-native development, the runtime is more container-aware, and the reduced footprint of applications helps with deployment density and startup time on platforms like Kubernetes.
Are there any notable low-level or API improvements?
Yes, the System.Text.Json namespace gained more features, narrowing the gap with Newtonsoft.Json, including support for immutable classes and deserializing with constructors.
Regular expressions received a complete overhaul with a new engine that offers significant performance improvements, especially for complex patterns. New Half and Int128/UInt128 types provide support for lower-precision and very large integers.
FAQ
Is .NET 5 the next version of .NET Framework or .NET Core?
.NET 5 is the direct successor to .NET Core 3.1. It's the next major release in the unified .NET platform, not a new version of the classic .NET Framework, which remains at version 4.8.
Should I use .NET 5 or .NET Standard for new libraries?
For new libraries, target .NET 5. While .NET Standard 2.0/2.1 is still supported for compatibility, .NET 5 is now the primary target for future-facing development and offers access to the latest APIs.
Can I upgrade my existing .NET Core 3.1 app to .NET 5?
Generally, yes. The upgrade path from .NET Core 3.1 to .NET 5 is designed to be straightforward. You'll need to update the target framework in your project file and potentially address a small number of breaking changes.
What happened to WinForms and WPF? Are they in .NET 5?
Yes, Windows Desktop applications built with WinForms and WPF are fully supported in .NET 5 and are included as part of the Windows SDK. They continue to be Windows-only technologies.
Is .NET 5 a Long-Term Support (LTS) release?
No, .NET 5 is a Standard Term Support (STS) release. It was supported for approximately 18 months. The next LTS release after .NET Core 3.1 is .NET 6.