.NET 8 is the current generation of Microsoft's free, cross-platform runtime and SDK for C#, F#, and VB.NET. It ranks #4 among trending tech tags at roughly 19.2% usage share. It's trending because it's a long-term-support (LTS) release with major performance gains, Native AOT compilation for near-instant startup, and a much simpler minimal API style for building web services.
.NET 8's minimal API style lets you define an entire small web service in one Program.cs file, without controllers or boilerplate startup classes.
// Program.cs
var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();
app.MapGet("/hello/{name}", (string name) =>
Results.Ok(new { message = $"Hello, {name}!" }));
app.MapPost("/orders", (Order order) =>
{
// order.Total, order.Customer etc. are already bound + validated
return Results.Created($"/orders/{order.Id}", order);
});
app.Run();
record Order(int Id, string Customer, decimal Total);
Install the .NET 8 SDK, then scaffold a new minimal web API project with the CLI.
# check installed SDKs / install .NET 8 from dotnet.microsoft.com first
dotnet --version
# scaffold a new minimal web API project
dotnet new webapi -n MyApi -minimal
cd MyApi
dotnet run