Dotnet Core Expert
Automate and integrate .NET Core Expert for robust application development workflows
.NET Core Expert is an AI skill that provides deep technical guidance for building production applications on the .NET platform. It covers ASP.NET Core web development, middleware pipeline design, performance tuning, deployment strategies, health checks, and cross-platform considerations that produce enterprise-grade .NET applications.
What Is This?
Overview
.NET Core Expert delivers advanced .NET development patterns beyond basic tutorials. It addresses middleware pipeline composition for request processing, Kestrel server configuration and performance tuning, health check endpoints for monitoring and orchestration integration, output caching and response compression for throughput optimization, hosted service patterns for background processing, and deployment strategies including containerized, self-contained, and framework-dependent publishing.
Who Should Use This
This skill serves .NET developers building high-performance web services, architects designing enterprise applications on the .NET platform, DevOps engineers deploying and operating .NET applications, and teams migrating from legacy .NET Framework to modern .NET.
Why Use It?
Problems It Solves
Default ASP.NET Core configurations are optimized for the development experience but require significant tuning to handle production traffic volumes effectively. Middleware ordering mistakes cause subtle bugs where authentication runs after authorization or logging misses errors. Without proper health checks, container orchestrators cannot determine application readiness. Background processing patterns implemented incorrectly can leak memory or miss shutdown signals.
Core Highlights
The skill configures Kestrel for production workloads with appropriate connection limits and timeouts. Middleware pipeline ordering follows security-first principles. Health check patterns integrate with Kubernetes liveness and readiness probes. Background services implement graceful shutdown that completes in-flight work before the application terminates. Deployment patterns address both containerized and traditional hosting scenarios.
How to Use It?
Basic Usage
// Production-ready ASP.NET Core configuration
var builder = WebApplication.CreateBuilder(args);
// Configure Kestrel for production
builder.WebHost.ConfigureKestrel(options =>
{
options.Limits.MaxConcurrentConnections = 1000;
options.Limits.MaxRequestBodySize = 10 * 1024 * 1024;
options.Limits.KeepAliveTimeout = TimeSpan.FromMinutes(2);
options.Limits.RequestHeadersTimeout = TimeSpan.FromSeconds(30);
});
builder.Services.AddHealthChecks()
.AddCheck<DatabaseHealthCheck>("database")
.AddCheck<RedisHealthCheck>("cache");
builder.Services.AddOutputCache(options =>
{
options.AddBasePolicy(b => b.Expire(TimeSpan.FromMinutes(5)));
options.AddPolicy("short", b => b.Expire(TimeSpan.FromSeconds(30)));
});
var app = builder.Build();
app.UseOutputCache();
app.MapHealthChecks("/health/live", new() { Predicate = _ => false });
app.MapHealthChecks("/health/ready");Real-World Examples
// Background processing with graceful shutdown
public class OrderProcessorService : BackgroundService
{
private readonly IServiceScopeFactory _scopeFactory;
private readonly ILogger<OrderProcessorService> _logger;
private readonly Channel<OrderMessage> _channel;
public OrderProcessorService(
IServiceScopeFactory scopeFactory,
ILogger<OrderProcessorService> logger,
Channel<OrderMessage> channel)
{
_scopeFactory = scopeFactory;
_logger = logger;
_channel = channel;
}
protected override async Task ExecuteAsync(CancellationToken ct)
{
_logger.LogInformation("Order processor starting");
await foreach (var message in _channel.Reader.ReadAllAsync(ct))
{
using var scope = _scopeFactory.CreateScope();
var processor = scope.ServiceProvider.GetRequiredService<IOrderProcessor>();
try
{
await processor.ProcessAsync(message, ct);
}
catch (Exception ex) when (ex is not OperationCanceledException)
{
_logger.LogError(ex, "Failed to process order {OrderId}", message.OrderId);
}
}
_logger.LogInformation("Order processor stopped");
}
}Advanced Tips
Use IServiceScopeFactory in background services to create proper dependency injection scopes for each unit of work. Configure structured logging with Serilog for queryable log output in production. Implement rate limiting middleware using the built-in Microsoft.AspNetCore.RateLimiting package rather than custom solutions.
When to Use It?
Use Cases
Use .NET Core Expert when building production web APIs that need performance tuning, when implementing background processing services that require reliable execution, when configuring health checks for container orchestration environments, or when optimizing application startup and request throughput.
Related Topics
ASP.NET Core middleware, Entity Framework Core optimization, gRPC services in .NET, Azure App Service and AKS deployment, and .NET Aspire for cloud-native development all complement advanced .NET development.
Important Notes
Requirements
.NET 8 SDK or later for access to the latest platform features. Understanding of the ASP.NET Core request pipeline and dependency injection model. A deployment target such as Docker, Kubernetes, or Azure App Service.
Usage Recommendations
Do: configure Kestrel limits explicitly for production rather than relying on defaults. Use cancellation tokens throughout background services for graceful shutdown. Implement structured health checks that verify actual dependency connectivity.
Don't: use Task.Run inside request handlers to fake async behavior, as this wastes thread pool threads. Register heavy dependencies as transient when they should be scoped or singleton. Skip load testing before deploying performance-sensitive configuration changes.
Limitations
Performance tuning results depend on the specific workload and infrastructure. Configuration values that work well for one deployment environment may need adjustment for another. The rapid evolution of the .NET platform means best practices may shift with each major release.
More Skills You Might Like
Explore similar skills to enhance your workflow
Landbot Automation
Automate Landbot operations through Composio's Landbot toolkit via Rube
Ruzzy
Seamlessly automate and integrate Ruzzy into your existing workflows
Close Automation
Automate Close CRM tasks via Rube MCP (Composio): create leads, manage calls/SMS, handle tasks, and track notes. Always search tools first for current
Newsletter Curation
Newsletter Curation automation and integration for discovering and organizing content
Chroma
Chroma vector database automation and integration for AI-powered applications
Ray Data
Scalable Ray Data automation and integration for distributed data processing pipelines