Getting Started with .NET Core 2.2: What’s New

It’s been a few weeks since Microsoft released .NET Core 2.2, and I’ve finally had the chance to dig into what’s new. If you’re still on 2.1 (which is LTS, so fair enough), here’s what you’re missing and whether it’s worth upgrading.

The Headline Features

.NET Core 2.2 isn’t a massive release, but it brings some genuinely useful improvements. Here’s what caught my attention:

Health Checks API

This is probably my favorite addition. If you’re running apps in Kubernetes or behind a load balancer, you need health endpoints. Previously, we had to build these ourselves. Now it’s built-in:

public void ConfigureServices(IServiceCollection services)
{
    services.AddHealthChecks()
        .AddSqlServer(Configuration.GetConnectionString("DefaultConnection"))
        .AddRedis(Configuration["Redis:ConnectionString"]);
}

public void Configure(IApplicationBuilder app)
{
    app.UseHealthChecks("/health");
}

The beauty is in the extensibility. You can add checks for databases, Redis, custom services—whatever you need. And Kubernetes liveness/readiness probes just work out of the box.

HTTP/2 in Kestrel

HTTP/2 support is now enabled by default on HTTPS endpoints. This means multiplexing, header compression, and better performance for modern browsers. You don’t need to do anything—just upgrade and you get it.

For gRPC scenarios (coming properly in .NET Core 3.0), this lays the groundwork.

Endpoint Routing

The routing system got a significant overhaul. Endpoint routing moves route matching earlier in the pipeline, which means middleware can now know about the selected endpoint before it executes:

public void Configure(IApplicationBuilder app)
{
    app.UseRouting();
    
    // Middleware here can access endpoint metadata
    app.UseAuthorization();
    
    app.UseEndpoints(endpoints =>
    {
        endpoints.MapControllers();
        endpoints.MapHealthChecks("/health");
    });
}

This pattern becomes the default in 3.0, so getting familiar with it now is a good idea.

Performance Improvements

The team continues to obsess over performance, and it shows:

  • Tiered compilation is now on by default – faster startup times
  • HttpClient performance improved by using SocketsHttpHandler
  • Span<T> adoption continues across the BCL

In my testing with a simple API, cold start improved by about 15%. Your mileage may vary, but it’s a nice win for container scenarios.

Entity Framework Core 2.2

EF Core got some love too:

  • Spatial data types – Finally! Geography and geometry support
  • Owned entity collections – Improved DDD support
  • Query tags – Add comments to generated SQL for easier debugging
var orders = context.Orders
    .TagWith("GetRecentOrders - called from Dashboard")
    .Where(o => o.CreatedDate > DateTime.UtcNow.AddDays(-7))
    .ToList();

// SQL includes: -- GetRecentOrders - called from Dashboard

Query tags are surprisingly useful when you’re staring at SQL Profiler trying to figure out which code path generated a slow query.

Should You Upgrade?

Here’s my take:

  • New projects: Yes, start with 2.2
  • Existing 2.1 LTS projects: Consider it if you need health checks or HTTP/2, otherwise wait for 3.0
  • Production systems: Test thoroughly – some behavioral changes in EF Core might surprise you

Remember, 2.2 is Current, not LTS. If you need long-term support, 2.1 is still your friend until 3.0 LTS arrives.

Upgrading

The upgrade itself is straightforward. Update your target framework and package references:

<PropertyGroup>
    <TargetFramework>netcoreapp2.2</TargetFramework>
</PropertyGroup>

<ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>

Run your tests, check for deprecation warnings, and you should be good.

What’s Next

.NET Core 3.0 is the big one. Desktop support (WPF, WinForms), C# 8.0, and the unification story are all coming. But for now, 2.2 is a solid stepping stone with genuine productivity improvements.

References


Discover more from C4: Container, Code, Cloud & Context

Subscribe to get the latest posts sent to your email.

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.