. NET — new releases review

For those who like code, not boring texts.

2025 brought us many technical gifts, and one of the nicest is .NET 10. The platform has gotten faster, smarter, and in some places just plain developer-friendly (as if Microsoft has finally heard our "want to do less to get more").

In this article we look at the most important features of .NET 10, how they affect the day-to-day work of programmers, and why upgrading is the best option.

Key performance improvements

.NET traditionally gets faster with each release, but this time the team decided to push harder on the gas

  • 🔧 JIT and GC are faster
    The algorithms are optimized so that most applications get a performance boost “just out of the box”.
    Code runs faster, GC runs smarter, and you think less about microtuning.
  • ⚡ New AOT compilation features
    AOT has become more mature and predictable. For many types of projects, it now runs more stable and produces smaller final binaries. A nice bonus: less time for cold start, which is critical for CLI utilities and serverless functions.

 

ASP.NET Core 10 is even lighter and cleaner

If you love Minimal APIs, .NET 10 will make your day:

  • Cleaner Middleware
    Code is shorter and more declarative. Less "noise", more substance.
  • Bigger rendering
    Razor Optimizations reduced latency and increased server throughput.
  • Improved logging
    More structured logs, better debugging and OpenTelemetry compatibility.

Novelties in .NET libraries

  • Cryptography with support for post-quantum algorithms:
    support for such algorithms as ML-KEM, ML-DSA and SLH-DSA is built in. For the developer this means: state-of-the-art data protection without “homegrown” solutions.
  • String APIs, Span/UTF-8, NumericOrdering:
    new methods allow you to work with byte sequences, string comparisons taking into account the numeric part, which makes data processing faster and more expressive.
  • Collections, JSON-serialization:
    added convenience methods in OrderedDictionary<TKey, TValue>, new options in System.Text.Json - for example, setting up cyclic references.
  • Other libraries:
    improvements to globalization, archive handling, (WebSocketStream) network APIs, and TLS/security for macOS.

C# 14 - the language has become even more user-friendly (and less nerdy)

With .NET 10 comes C# 14, which moves toward greater brevity and simplicity.

The updates are nice and practical:

  • improved switch expressions;
  • expanded support for collection expressions;
  • convenient inline code in many constructs;
  • more contexts where you can remove unnecessary boilerplate.

File-based apps and the #:sdk, #:package, #:property directives are the nicest feature of the release

! or: “why many developers will have a myscript.cs file on Desktop for the first time in 10 years”

In .NET 10, there's a really cool — file-based apps feature: you can just take a .cs file and run it through dotnet run app.cs, without .csproj or .sln.

But the best part is the new directives that are written right at the beginning of this .cs file. And it's a game changer.

What these directives are and how to use them

In the file, you can prescribe the following directives (with #:) to customize the behavior of your file-based application:

  • #:sdk — specifies which SDK to use to run. By default .NET 10 uses Microsoft.NET.Sdk, but you can change it to, for example, Microsoft.NET.Sdk.Web if you want to create an API or web application.
  • #:package adds NuGet packages directly from the .cs file. This means you don't need to create .csproj to plug in the library - just type this directive.
  • #:property makes it possible to set MSBuild properties (e.g. LangVersion, PublishAot, etc.) directly in the code.

What are the benefits for you as a developer?

  1. Fast start and minimalism
    No need to create a full-fledged project - one .cs file, and you're done. Perfect for scripts, utilities, automation or just a quick experiment.
  2. Flexibility of dependencies
    You can plug in NuGet packages exactly when you need them, right from the file. Without rewriting .csproj - just #:package… This is especially handy when you're making a small script but still want to take advantage of powerful libraries.
  3. Compile Control
    Via #:property you can set, for example, PublishAot=false if the library you're plugging in is not compatible with AOT (native compilation), or change the language version (LangVersion).
  4. Publishing native apps
    File-based apps now support dotnet publish app.cs, and, by default, the target is native AOT. That means: a script that turns into a small self-contained executable file.
  5. Scripts “as on Unix”
    shebang (#!) is supported - you can make .cs-file executable on Unix-like systems by adding something like:

#!/usr/bin/env dotnet run  
Console.WriteLine("Привіт із C#-скрипта!");

Then chmod +x app.cs — and the file runs as a script.

6.  Smooth transition to “large” project
When the logic gets more complex - you don't need to rewrite everything manually. It is enough to perform:

dotnet project convert app.cs

.NET will create .csproj, move the dependencies and properties from the #: directives to the appropriate sections, and you'll have a complete project.

Examples "in action": what it might look like

Here are a few scenarios of how file-based apps + directives can really come in handy:

Example 1 — a quick script from NuGet

#:package Newtonsoft.Json@13.0.3

using Newtonsoft.Json;

var person = new { Name = "Іван", Age = 30 };
string json = JsonConvert.SerializeObject(person);
Console.WriteLine(json);

  • There we connect Newtonsoft.Json directly via #:package.
  • Run as dotnet run script.cs.
  • Minimal configurations - maximum functionality.

Example 2 — web API “in one file”

#!/usr/bin/env dotnet run
#:sdk Microsoft.NET.Sdk.Web  
#:package Microsoft.AspNetCore.OpenApi@10.*-*  
#:property PublishAot=false

var builder = WebApplication.CreateBuilder();
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddOpenApi();

var app = builder.Build();
app.MapGet("/", () => "Hello from the single-file API on .NET 10!");
app.Run();

  • #:sdk Microsoft.NET.Sdk.Web — makes the file a “web application” (Minimal API).
  • #:package connects OpenAPI/Swagger.
  • #:property PublishAot=false turns off AOT if required.
  • Shebang gives the ability to run as a script on Unix.

Why it's cool in terms of your productivity and code

  • Minimum “noise”: no templates, no unnecessary files - just code that works.
  • Flexible configuration: no heavy .csproj files, but with all the necessary dependencies.
  • Fast Prototyping: if you want to try an idea, just write a file and run it.
  • Scaling on the go: if one file gets "serious", turn it into a project on command, without rewriting.
  • CLI utilities, scripts, configuration tools: file-based apps are a great option for creating lightweight tools that can be portable, run without deploying a full project.

Yes, it's a real working web service in one file! Yes, it's convenient! And yes, it makes Python a little nervous...

 

Limitations and what to consider

  • At the time of previous versions, multi-file scripting support was still limited - many blogs indicate that this is planned for .NET 11.
  • For complex scripts (many classes, dependencies, configurations) it is still better to go to a full-fledged project.
  • DE support (e.g. IntelliSense, debug) for file-based apps may not yet be as deep as for a regular project (depending on extensions). But this is all improving rapidly.

Other important changes

There are a lot of things to write about, but we'll focus on the basics, in our opinion.

  • Improved Linux and container support
    Images are smaller, faster, and more secure.
  • Expanded analytics and diagnostics
    More APIs for profiling and telemetry, easier to find bottleneck’s.
  • New features in MAUI
    Improved stability, faster UI rendering, and updated controllers.

Practical tips for getting started with .NET 10

  • If you are writing a utility or script — try creating a tool.cs file, and run:

dotnet run tool.cs

Use #:package to add NuGet libraries.

  • For a typical project - upgrade the SDK to .NET 10, test the scenarios you're interested in (with limit load, memory usage).
  • Consider whether your code can take advantage of file-based apps - perhaps some of the tasks you're doing are manual or scripted - and now move to C#.
  • In IDE (e.g., Visual Studio Code), make sure that the extension for C# supports the new #: directives.
  • In the context of CLI-tools or DevOps packages — consider whether you can simplify the creation without a (.csproj)  project and share the script with clients or colleagues.

As a conclusion

.NET 10 is not a “cosmetic update”. This release actually makes life easier for developers, gives them more freedom, removes unnecessary rituals, and allows them to focus on code rather than configurations.

File-based apps + directives is, without exaggeration, the most pleasant surprise of the year. And AOT, performance optimizations, and the Update ASP.NET Core make the platform even stronger. If you work with .NET - this release is definitely worth a try today.

And RealHOST has already made sure you have a reliable and convenient environment that is fully prepared for the new version of .NET 10.