Updated for .NET 10 Previews 2 and 3
The .NET 10 Preview has officially arrived, and with it come a bunch of sweet features - some small but super powerful, others game-changing. If you’ve been on the edge of your seat waiting to see what the .NET Team has up their sleeves, you’re in the right place. I watched the .NET 10 release video and read up, so that you don’t have to.
If you haven’t found it yet, you can get the preview bits from the official .NET blog. You’ll see a big post with download links for all the major platforms - SDK, runtime, container images, etc. If you’re the sort of developer who likes to watch features get built in real time, check out the .NET GitHub Repositories and subscribe to release notes there. The entire process is done in the open just the way we like it.
The usual disclaimers apply: This is a preview release. Feel free to use it in your experiments, demos, or proof-of-concept projects, but maybe hold off on throwing it into high-stakes production scenarios...unless you like living on the edge.
.NET 10 Preview 3 just crash-landed ("crash" is probably a bad word to use when describing a new software release...), and it's looking pretty great. The CLI got even better with revamped tab completion and the long-awaited ability to pin SDK versions locally per-repo via global.json
(kiss global install clutter goodbye!). Container publishing also shed some boilerplate, making it default-on. For the web folks, Blazor now offers declarative state persistence to ditch that annoying pre-render flicker, plus smarter cache-busting for standalone WASM apps using import maps. But the real headliner is C# 14's preview features: the game-changing extension
syntax finally brings extension properties (static and instance!) into the fold, alongside handy null-conditional assignments (?.=
). And don't forget Minimal APIs - they now boast built-in, AOT-friendly validation (no more excuses!), while native Server-Sent Events (SSE) support lets you get your stream on easily. Go grab the bits and break something!
The big C# highlights:
1. field
Keyword in Auto-Properties
You can now reference the compiler-generated backing field of an auto-property using field
. Example:
public string LastName { get => field; set => field = value.Trim(); }
No more messing with private fields just to do small tweaks - this keeps your code lean and maintainable.
2. Lambda Parameter Modifiers
You know how you could never do ref or out in a short-form lambda parameter list? That’s changed. So if your delegate expects an out parameter, your short-form lambda can handle it. Small, but it squishes an old annoyance.
3. Nameof + Generics
You can use nameof on open generic types without specifying type parameters. Super tiny improvement, but one less “why do I have to specify this?” moment.
4. First-Class Span
The language now treats Span<T> and ReadOnlySpan<T> more like first-class citizens. For library authors, extension methods that target ReadOnlySpan<T> or Span<T> will now work more consistently - especially with conversions from arrays. Translation: less boilerplate for you, better performance in your .NET apps.
5. UTF-8 String Literals & Large Strings
There’s a new experimental switch that encodes string literals as UTF-8 in a separate data section. If you’ve ever been blocked by that old “exceeds the 24-bit string-length limit,” or you just want smaller DLLs, this might be your saving grace. It’s a behind-the-scenes fix that can drastically reduce assembly size for projects loaded with text.
6. Partial Events and Constructors (Added in Preview 2)
Adds support for partial instance constructors and partial events, complementing partial methods and properties introduced in C# 13. This gives you more flexibility in how you organize your code across partial classes.
If you’re still a diehard VB fan, you can rest assured the VB team hasn’t forgotten you:
unmanaged
Constraint Support: VB can now handle generic type parameters marked unmanaged
. Translation? You can consume more of those awesome new libraries that rely on unmanaged generics without the compiler throwing up.F# typically runs on its own release schedule, so there’s no major preview update specifically from the F# folks called out here. Keep an eye on F# repo discussions if you're an F# fan - there’s always something going on.
ASP.NET Core devs, get ready for some awesome goodness:
1. Open API 3.1 Support
Previously, ASP.NET Core defaulted to Open API 3.0. Now you can produce official Open API 3.1 docs out-of-the-box. Under the hood, it uses a newer version of the Microsoft.OpenApi
library, which properly supports JSON Schema 2020-12.
nullable
property; instead, type
becomes an array that includes "null"
). Some tooling might need an update, so keep your eyes peeled.2. YAML Format
Want your Open API doc in YAML instead of JSON? Now possible. Just tack on a .yaml
or .yml
route suffix when calling MapOpenApi
. Handy for teams that prefer eyeballing YAML over JSON.
3. ProducesResponseType Description
You can now add descriptions right in [ProducesResponseType]
.
[ProducesResponseType(typeof(Book), StatusCodes.Status200OK, Description = "Returns a book by ID.")] public IActionResult GetBook(int id) { ... }
Makes the generated docs more descriptive for your endpoints.
4. IsLocalUrl Helper
There’s a new helper method RedirectHttpContextExtensions.IsLocalUrl(...)
to check if a URL is local. This is super useful if you’re building custom redirection logic and need to ensure you’re not accidentally sending users to malicious external sites.
5. Integration Testing & Top-Level Statements
If you hopped on the top-level statement train in .NET 9, you might have noticed integration testing was a bit painful. The test project couldn’t see your hidden Program
class. That’s addressed in .NET 10, so the testing story is smoother.
6. Blazor Enhancements (Added in Preview 2)
Added the ReconnectModal component to the Blazor Web App project template for improved reconnection UI control
7. Authentication and Authorization Metrics (Added in Preview 2)
New metrics for authentication and authorization events to help you monitor and troubleshoot security-related issues in your applications.
If you’ve been tracking the Microsoft.Extensions.Caching.Hybrid
package, there’s good news: it’s basically feature complete and heading out of preview soon. Highlights:
GetOrCreateAsync
and everything else - like serialization, storing, retrieving, stampede prevention—happens automagically.// Adding tags var result = await hybridCache.GetOrCreateAsync( "my-key", new HybridCacheEntryOptions { Tags = new[] { "General", "Sales" }, // ... other caching options }, () => expensiveDataFetch() ); // Invalidating everything tagged "Sales" await hybridCache.RemoveByTagAsync("Sales");
Great for scenarios where you need to flush multiple cache entries—like all products in a certain category - without brute-force scanning your entire store
IDistributedCache
, so you can plug in Redis, SQL Server, Azure Cache for Redis, or any existing distributed provider. No crazy rewrites needed.If you’re game to try it in your apps, you can do so now (though it’s still labeled “preview”). Official non-preview status is just around the corner.
The .NET 10 runtime introduces several performance enhancements that make your applications faster:
The .NET 10 libraries bring lots more features:
Entity Framework Core 10 introduces a bunch of new stuff:
This is just Preview 2 - there’s much more to come with future previews of .NET 10. Keep watching the .NET Blog, GitHub discussions, and your favorite .NET-themed YouTubers for deeper dives and demos.
Span<T>
.If you’d rather watch the daily dev hustle happen in real-time, jump over to the .NET GitHub repo. PRs are open for your perusal, and you can see how the sausage is made (so to speak).
Your mission, should you choose to accept it:
Pro Tip: If you’re building libraries, start testing them against the preview to ensure a smooth transition when .NET 10 officially ships. Nothing’s worse than a “surprise” bug that sneaks in at the eleventh hour.
The .NET 10 Preview is packed with iterative improvements across the board, from language enhancements (hello, field
keyword) to more robust Open API documentation in ASP.NET Core, to supercharged caching with Hybrid Cache’s new tagging.
The early preview cycle is your chance to shape how these features evolve - so don’t hold back on the feedback. And, of course, stay tuned to the usual .NET channels for more announcements (and more previews!) on the road to the final .NET 10 release.