New in .NET 9: Your Guide to the Latest and Greatest
by DeeDee Walsh, on Mar 1, 2024 12:19:31 PM
ICYMI - .NET 9 is here, and it's looking pretty sharp (I was going to make C# joke but decided against it). This release brings a bunch of good stuff that's focused on cloud-native development, performance improvements, and some very nice new features. Think of this as your cheat sheet before you download the preview.
Let's Dive In
Here's a quick breakdown of the cool stuff to watch out for:
AI Gets Even Smarter
Microsoft is doubling down on making .NET a powerful platform for building intelligent applications. In .NET 9, you can expect:
OpenAI and OSS Made Easy: The focus is on streamlining how .NET developers can work with OpenAI models and other popular open-source AI models (both for hosting and using them within apps). Think better libraries, more focused documentation, and samples to get you started faster.
Building on Success: Projects like the "ChatGPT + Enterprise Data with Azure Open AI and Cognitive Search .NET Sample" are being actively updated to show how to leverage the latest .NET 9 features. It's a great way to see how .NET, Azure, and AI come together in action.
Important Note: .NET 9 is still evolving. While the direction is clear, the specifics of what new AI-focused APIs or tools we'll see are still being worked out. Stay tuned to the GitHub discussions and release notes for the latest.
Serialization Tweaks: The System.Text.Json
namespace .gets better! You now have options to customize your JSON output with indentation and even a singleton for easy use of ASP.NET Core's web defaults.
LINQ McLovin' (yes, I was watching Superbad while writing this): Get ready for the new CountBy
and AggregateBy
methods within LINQ. These are lifesavers when you need to quickly find frequencies or perform more complex aggregations without the messy GroupBy
workarounds. Oh, and don't miss the Index()
method for easy indexing inside your enumerables!
Collection Upgrades: Working with PriorityQueue<TElement, TPriority>
? You can finally update the priority of an item on the fly with the new Remove()
method. This might not change the world of algorithms, but it definitely makes certain scenarios way easier!
Cryptography Gets a Boost: There's a new one-shot CryptographicOperations.HashData()
method for hashing and HMAC when you need that flexibility. Also, the KMAC algorithm (based on NIST SP-800-185) is now supported with dedicated classes.
Reflection Enhancements: Remember how you couldn't save dynamically created assemblies in previous .NET versions? Well, .NET 9 fixes that with new public APIs on AssemblyBuilder
. You can finally persist those generated assemblies!
Wait, There's More...
Of course, this is just a taste. .NET 9 has a ton of focus on cloud-native app development, intelligent apps with AI integrations, and tons of under-the-hood improvements in established areas!
Get Your Hands Dirty
Ready to try it out?
- .NET 9 Preview 1 is available for download. Check it out!
- Want the full deep dive? See the official release notes
Give Your Feedback
Microsoft is trying something new by posting previews and updates on GitHub discussions at https://github.com/dotnet/core/discussions/9131. Let them know what you like, what you don't like, and what you think is missing. Remember, we help shape the future of .NET and it's a big responsibility to help make it the best it can be.