.NET Core 3.1 (LTS, released December 2019) is the stable foundation for .NET microservices in 2020. The gRPC support, worker services, and improved Docker tooling make it the most production-ready .NET release for cloud-native development.

Worker services for background processing

The Worker Service project template in .NET Core 3.1 provides a hosted service abstraction for background processes: message consumers, scheduled tasks, and event processors. The IHostedService and BackgroundService base classes integrate with the generic host, providing: dependency injection, configuration, logging, graceful shutdown handling, and health checks. Worker services run as console applications that deploy well in containers.

gRPC in ASP.NET Core

ASP.NET Core 3.1 includes first-class gRPC support via the Grpc.AspNetCore package. The protobuf-net and Google.Protobuf packages generate C# code from .proto files. The ASP.NET Core gRPC server implementation uses managed .NET sockets (Kestrel) rather than native gRPC libraries. The development experience (shared .proto contracts, generated strongly typed clients) is a significant improvement over REST for internal service communication.

Health checks and liveness probes

The Microsoft.Extensions.Diagnostics.HealthChecks package provides: health check registration, health check endpoints, and built-in checks for common dependencies (EF Core DbContext connectivity, SQL Server, Redis, Azure Service Bus). The /health endpoint is consumed by Kubernetes liveness and readiness probes. Health checks with 'Degraded' status (dependency is slow but reachable) can be surfaced in metrics without failing the readiness probe.

Docker and container optimisation

.NET Core 3.1 with Docker multi-stage builds and the Microsoft Container Registry base images provides a lean production image. The recommended approach for ASP.NET Core: mcr.microsoft.com/dotnet/aspnet:3.1 (runtime image, ~100MB) as the production base, publish with dotnet publish -c Release -r linux-x64 --self-contained false for dependency-only publish, and a multi-stage build that separates SDK (build) from runtime (production) layers.