What Is New in .NET Core 2.2
.NET Core 2.2 introduces a set of enhancements focused on developer productivity, cloud-native application development, and diagnostics. The key updates are summarized in the table below.
| Category | Key Changes |
|---|---|
| Runtime & Compiler | JIT compiler tiering, ReadyToRun images, API lifecycle attributes |
| ASP.NET Core | HTTP/2 in Kestrel, Health Checks API, Endpoint Routing, SignalR Java client, new project templates |
| Diagnostics | EventPipe for cross-platform diagnostics, Azure Application Insights integration |
| Deployment | Container optimizations, support for building container images |
| Entity Framework Core | Queryable data seeding, spatial data support, owned entity collections |
How did the JIT compiler improve in .NET Core 2.2?
The Just-In-Time (JIT) compiler gained a significant performance feature called tiered compilation. This allows methods to be initially compiled quickly with minimal optimizations. Frequently used methods are then recompiled in the background with a higher level of optimization.
In practice, this means applications start faster because the JIT doesn't spend time on deep optimizations for code that only runs once. The high-quality optimizations are reserved for the hot paths that actually impact performance, leading to a better balance between startup time and throughput.
What are the new deployment options for .NET Core 2.2?
.NET Core 2.2 made it easier to deploy applications to modern environments like Docker containers. You could now build ReadyToRun (R2R) images, a form of ahead-of-time compilation.
R2R reduces startup time by precompiling the application's IL code into native machine code. This is a major benefit for containerized scenarios where fast startup is critical. The build system also integrated support for creating container images directly.
What ASP.NET Core features were introduced?
ASP.NET Core received a substantial update with features for building robust, modern web services. Kestrel, the built-in web server, added support for HTTP/2, enabling more efficient communication.
The new Health Checks API provides a standardized way to report your application's health, which is essential for orchestration tools like Kubernetes. Endpoint Routing was introduced, giving more control over request dispatch and enabling link generation. SignalR also expanded its reach with an official Java client.
How did diagnostics get better?
Cross-platform diagnostics became a first-class citizen with EventPipe. This mechanism allows you to capture events, such as those from EventSource, and performance data on any operating system that .NET Core runs on.
This matters because it replaced the Windows-specific ETW for many scenarios, providing a unified way to profile and monitor applications on Linux and macOS. The integration with Azure Application Insights also became more seamless.
What changed in Entity Framework Core 2.2?
EF Core 2.2 added several highly requested data access features. Queryable data seeding allows you to define initial data in the model, which is then automatically added to the database and can be queried like any other data.
Support for spatial data types via NetTopologySuite enabled developers to work with geographic locations directly in their LINQ queries. The addition of owned entity collections provided more flexibility in modeling complex types.
FAQ
Is HTTP/2 enabled by default in Kestrel?
No, you must explicitly configure Kestrel to listen on an HTTPS endpoint, as HTTP/2 requires encrypted connections. The protocol negotiation is then handled automatically for compatible clients.
What is the main benefit of tiered compilation?
It improves startup performance by using a faster, less-optimized JIT for initial execution. Methods that are called repeatedly get re-compiled with full optimizations, improving long-running performance without the initial penalty.
Can I use ReadyToRun (R2R) on any platform?
R2R is a deployment option that is platform-specific. You must build your application for each target runtime environment (e.g., Linux x64, Windows x86) to generate the corresponding native code.
How do I use the new Health Checks API?
You add the health checks service in Startup.ConfigureServices and then map a health check endpoint in Startup.Configure. You can create custom checks for your dependencies (databases, APIs) to report overall application status.
What replaced EventSource for cross-platform event logging?
EventPipe is the primary cross-platform technology for event logging and performance data collection in .NET Core 2.2 and later. It works consistently across Windows, Linux, and macOS.