Introduction
Microsoft has announced .NET 8 recently. It emphasized the cloud, performance, full-stack Blazor and .NET MAUI as major highlights of the latest edition of the company’s free, cross-platform, open-source developer platform.
Of special importance to enterprises, .NET 8 is a long-term support (LTS), which means it will be supported and patched for three years as opposed to 18 months for a standard term support (STS) release.
Performance
Digging into some of the new details, .NET 8 introduces a new code generator, Dynamic Profile-Guided Optimization (PGO), which optimizes code based on real-world usage. This feature can improve app performance by up to 20 percent. The AVX-512 instruction set, which enables parallel operations on 512-bit vectors of data, is supported and used in .NET 8, allowing for much more data processing in less time. Also, Primitive types now implement a new formattable and passable interface, enabling them to directly format and parse as UTF-8 without any transcoding overhead.
The major focus for .NET MAUI in the .NET 8 release is quality. As such, a lot of the focus has been fixing bugs. But still having plenty of performance changes that focus to the areas such as Build & Inner Loop Performance; Performance / App Size Improvements; Memory Leaks; Tooling and Documentation.
ASP.NET Core in .NET 8 is the fastest release yet! Compared to .NET 7, ASP.NET Core in .NET 8 is 18% faster on the TechEmpower JSON benchmark and 24% faster on the Fortunes benchmark:

Cloud
While .NET 8 includes boosts cloud-native development in a number of ways, including many container enhancements for example, the big news here is the availability of the first preview of .NET Aspire, an opinionated stack for building resilient, observable and configurable cloud-native applications.
In this context, “opinionated” means the tech guides users into a certain way of doing things or is designed with specific conventions and assumptions about the best way to do things, and .NET Aspire comes with a curated set of components enhanced for cloud-native development, including telemetry, resilience, configuration and health checks by default.
Building resilient apps is a fundamental requirement for cloud development. With .NET 8, the Microsoft.Extensions.Http.Resilience and Microsoft.Extensions.Resilience packages are introduced to the .NET ecosystem. These new libraries are based on the Polly library, a widely recognized open-source project.
APS.NET Core
Let’s take a look at some of the great new features and improvements now available with ASP.NET Core in .NET 8.
Native AOT
It’s now possible to publish an ASP.NET Core app with native AOT, producing a self-contained app that’s ahead-of-time (AOT) compiled to native code.
Native AOT apps can have a smaller deployment size, start up very quickly, and use less memory. The application can be run on a machine that doesn’t have the .NET runtime installed.
Publishing and deploying a native AOT app with ASP.NET Core are now introduced some benefits such as
- Reduced disk footprint: When publishing using native AOT, a single executable is produced containing the program along with the subset of code from external dependencies that the program uses.
- Reduced startup time: Native AOT applications can start-up more quickly, in part due to the removal of JIT compilation. Reduced start-up means the app is ready to service requests quicker.
- Reduced memory demand: ASP.NET Core apps published as native AOT can have reduced memory demands depending on the work being performed, as they enable the new DATAS GC mode by default. Reduced memory consumption can lead to greater deployment density and improved scalability.
But not all features in ASP.NET Core are compatible with native AOT. Similarly, not all libraries commonly used in ASP.NET Core are compatible with native AOT. .NET 8 represents the start of work to enable native AOT in ASP.NET Core, with an initial focus on enabling support for apps using Minimal APIs or gRPC, and deployed in cloud environments.
Full stack web UI with Blazor
Blazor in .NET 8 has grown from being a compelling client web UI framework to a full-stack web UI framework that can handle all of your web UI needs. Blazor in .NET 8 combines the strengths of Blazor WebAssembly, Blazor Server, and advanced server-side rendering techniques into a single component-based framework.
By leveraging both the client and server, Blazor enables you to deliver an optimized web UI experience that will delight your users.
Blazor in .NET 8 now supports the following new capabilities:
- Static server-side rendering: Host Blazor components as ASP.NET Core endpoints that render static HTML in response to requests, so that content renders immediately without the need to download any client code.
- Enhanced navigation & form handling: Blazor will automatically enhance how pages are loaded and form requests are handled by intercepting these requests and then programmatically patching the server rendered content into the DOM. Your app feels fast and smooth like a single-page app even though it’s still doing static server-side rendering.
- Streaming rendering: Immediately render components to get pixels on the screen fast while long running async tasks execute, and then automatically stream updates to the browser as content becomes available.
- Enable interactivity per component or page: Enable interactive rendering based on Blazor Server or Blazor WebAssembly for individual components or pages using the new @rendermode Razor directive.
- Auto select the render mode at runtime: Automatically shift users from the server to the client at runtime to improve app load time and scalability. The component initially renders interactively using Blazor Server while the .NET WebAssembly runtime is downloaded in the background.
Blazor also includes many new built-in components and capabilities that make you more productive and help get the job done fast.
Identity API endpoints
ASP.NET Core now provides API endpoints for interacting with ASP.NET Core Identity. These endpoints enable programmatic access to functionality for registering and logging in users, which simplifies setting up authentication for browser and mobile client apps. The endpoints can be used for both cookie and token-based authentication.
Metrics
Metrics are numerical measurements reported over time, like requests received per second, or the number of error responses sent. Metrics are used to monitor the health of apps and raise alerts.
ASP.NET Core now provides rich runtime metrics using System.Diagnostics.Metrics, a new cross-platform API designed in close collaboration with the OpenTelemetry community.
Those were just a sampling of what’s new in ASP.NET Core for .NET 8. For the full list, check out the ASP.NET Core in .NET 8 release notes.
EF Core 8
EF Core 8, or just EF8, is the successor to EF Core 7. EF8 requires .NET 8. It will not work with .NET 6 or 7, or with any version of .NET Framework.
Let have a look at the two interesting enhancements in EF8.
Value objects using Complex Types
Prior to EF8, there was no good way to map objects that are structured to hold multiple values, but do not have a key defining identity. For example, Address, Coordinate. Owned types can be used, but since owned types are actually entity types, they have semantics based on a key value, even when that key value is hidden.
EF8 now supports “Complex Types” to cover this type of “value object”. Complex type objects:
- Are not identified or tracked by key value.
- Must be defined as part of an entity type. (In other words, you cannot have a DbSet of a complex type.)
- Can be either .NET value types or reference types (Owned types must reference types.)
- Instances can be shared by multiple properties. (Owned type instances cannot be shared.)
Notice that the complex types do not get their own tables.
Primitive collections
A persistent question when using relational databases is what to do with collections of primitive types; that is, lists or arrays of integers, date/times, strings, and so on. A common approach is to serialize the primitive collection into a type that is handled by the database–for example, serialize to and from a string with comma delimiters.
EF8 now includes built-in support for this kind of mapping, using JSON as the serialization format. JSON works well for this since modern relational databases include built-in mechanisms for querying and manipulating JSON, such that the JSON column can, effectively, be treated as a table when needed, without the overhead of actually creating that table.
EF Core can map the collections of primitive types to a JSON column in the database. The collection property must be typed as IEnumerable<T>, where T is a primitive type, and at runtime the collection object must implement IList<T>, indicating that it is ordered and supports random access.
EF is using the SQL Server OPENJSON function to parse the JSON saved into the column and treat it like a table.
For the full list, check out What’s New in EF Core 8.
.NET MAUI
“.NET MAUI provides you a single project system and single codebase to build WinUI, Mac Catalyst, iOS, and Android applications,” Microsoft said. The company dubbed it the “evolution” of Xamarin.Forms because it added desktop support to provide a unified development experience across Android, iOS, macOS and Windows, helping developers reach a wider audience.
In .NET 8, the framework extends its reach with additional support for the latest mobile OSes and sees improvements to performance, reliability and the developer experience.
“Native AOT (experimental) now supports targeting iOS-like platforms. A new Visual Studio Code extension for .NET MAUI gives you the tools you need to develop cross-platform .NET mobile and desktop apps. Xcode 15 and Android API 34 are now supported allowing you to target the latest version of iOS and Android. A plethora of quality improvements were made to the areas of performance, controls and UI elements, and platform-specific behavior, such as desktop interaction adding better click handling, keyboard listeners and more.”
C#12
Last but not least, many new features included in C#12 are ready for you to discover.
“You can now create primary constructors in any class and struct with a simple and elegant syntax,” Microsoft said about new features in its flagship programming language.
“No more boilerplate code to initialize your fields and properties. Be delighted when creating arrays, spans, and other collection types with a concise and expressive syntax. Use new default values for parameters in lambda expressions. No more overloading or null checks to handle optional arguments. You can even use the using alias directive to alias any type, not just named types!”
Check out What’s new in C# 12 for the full list.
1 thought on “What’s new in .NET 8”
Pingback: What’s New in .NET 8 – Curated SQL