November 12th, 2024

Announcing .NET 9

Today, we are excited to announce the launch of .NET 9, the most productive, modern, secure, intelligent, and performant release of .NET yet. It’s the result of another year of effort on the part of thousands of developers from around the world. This new release includes thousands of performance, security, and functional improvements. You will find sweeping enhancements across the entire .NET stack from the programming languages, developer tools, and workloads enabling you to build with a unified platform and easily infuse your apps with AI.

Overview of .NET with workloads, tools, ecosystem, and OS

Downloads of .NET 9 and updates to Visual Studio 2022 and the C# Dev Kit for Visual Studio Code are available now.

The .NET team, our partners, and the .NET community showcased what’s new in .NET 9 and went deep on features at .NET Conf 2024. Sessions are available on-demand so you can catch up on all of the excitement including the keynote.

Let’s look at highlights in .NET across developer languages, workloads, and tools.

Unparalleled Performance – faster apps, lower memory

.NET 9 is the most performant release of .NET yet with over 1,000 performance related changes across the runtime, workloads, and languages with more efficient algorithms that generate better code. Stephen Toub did a deep dive into .NET 9 performance improvements, that is a must read, but let’s discuss a few highlights in this release.

The Server GC has been significantly changed to be adaptive to application memory requirements as opposed to the resources (memory and CPU) available in the environment (machine/VM/container). This change in approach has a profound impact in high core-count environments, where application memory is small or changes dramatically over time. Until now, Workstation and Server GC implementations delivered distinct results and required users to make tradeoff decisions between them. This change should be particularly attractive to anyone using workstation GC to control the memory use of cloud apps. The memory benefit comes with a modest throughput cost, which may or may not be observable. Server GC can be configured to use the legacy implementation, which may be useful for testing.

The TechEmpower benchmark is no match for .NET 9, with higher throughput and a dramatic drop in memory usage. The memory drop is due to the Server GC changes.

Chart showing 15% increase in RPS and 93% decrease in memory

The runtime returned to vectorization, adding support for new silicon, both Arm64 SVE, Intel AVX10, and hardware-accelerating the runtime. RyuJIT improves performance for Arm64, loops, PGO, and bounds checks. Exceptions are 50% faster, due to adopting the same exception model used by Native AOT.

Dynamic Profile Guided Optimization (PGO) has been updated to optimize more code patterns. The JIT now generates fast-path code for both common and unseen type casts in an application. Casts, like (IFoo)myFoo and myFoo is IFoo are very common in C#. It can also unroll and vectorize some operations on buffers for common buffer lengths it observes. This change results in 70% faster execution, although requires ReadyToRun to be disabled.

LINQ has been optimized for a variety of common cases. Methods such as Take and DefaultIfEmpty now return — up to 10x — faster when the underlying array, collection, or enumerable is empty. Enumerable.SequenceEqual already special-cases array inputs, by delegating the operation to MemoryExtensions.SequenceEquals, enabling efficient iteration and vectorization, by passing the arrays as spans. This capability is now available for List<T>.

Low-level details of System.Text.Json have been significantly optimized, with >50% improvements for various operations. JsonProperty.WriteTo can now directly write UTF8 bytes to avoid a string allocation. The new JsonMarshal.GetRawUtf8Value API returns UTF8 bytes, as an alternative to JsonElement.GetRawText, which returns a string and requires encoding and an allocation. JsonObject can now correctly size its underlying backing story if a count can be retrieved from the enumerable it is given, avoiding allocation and re-sizing costs.

In addition to these foundational improvements to .NET, you will find performance enhancements across all app types, so read on to learn more.

.NET Aspire – Foundational building blocks to build better apps

.NET Aspire is a set of powerful tools, templates, and packages for seamless development of observable, production-ready apps. It’s been just six months since the first release of .NET Aspire, and we’ve already made improvements to all parts of the stack, from new features in the telemetry and metrics dashboard to more streamlined deployment of cloud apps. It’s been great to see the adoption of .NET Aspire across applications of all types and watch the community embrace the Integrations and tooling for their scenarios. Plus, we’ve seen great adoption here at Microsoft – both the Xbox and Copilot teams have integrated .NET Aspire into their existing services, tightening their inner development loop with easily accessible insights and various compatible Azure Integrations.

Overview of .NET Aspire

Today’s release of .NET Aspire 9 brings some of your top requested features to help streamline your app development. You can now start and stop resources from the dashboard, keep containers alive between debug sessions, and access new APIs including WaitFor to better manage resource startup. We have worked closely with the community to launch new seamless Integrations for OpenAI, Ollama, Milvus, and many more. We’ve simplified the acquisition of .NET Aspire to more easily adopt it into your application, improved deployment scenarios with Azure Container Apps, and we’re pleased to announce preview support for Azure Functions with .NET Aspire.

Overview of new features in .NET Aspire 9

There is so much more in .NET Aspire for you to explore from our tooling to the broader ecosystem, such as the new .NET Aspire Community Toolkit. If you’re looking to get started with .NET Aspire, then look no further than our free courses on Microsoft Learn and the new .NET Aspire credential to help you on your .NET Aspire journey. And of course, let us know what you think of .NET Aspire, whether that’s on our GitHub, the .NET Discord, or during one of our live streams!

Artificial Intelligence – A Growing & Thriving AI Ecosystem

We continue to expand .NET capabilities for building and infusing applications with AI. There are new learning materials and samples, simplified integrations into our ecosystem, collaborations with partners to build a vibrant AI community, and it is more seamless than ever to deploy AI solutions to the cloud. Companies across the industry have embraced .NET to build top-tier AI experiences for their customers including H&R Block, Blip, and KPMG. .NET powers your favorite coding assistant, GitHub Copilot, and the brand-new Microsoft Copilot experience was rebuilt from the group up with .NET.

It is crucial that developers have access to the latest advancements when building AI services and apps. This is why we have worked with partners like Azure, OpenAI, LlamaIndex, Qdrant, Pinecone, Milvus, AutoGen, OllamaSharp, ONNX Runtime, and many others throughout the AI ecosystem to deliver a robust set of offerings to .NET developers.

AI ecosystem overview for .NET showing libraries and components

We have also made it easier to integrate AI infused controls into your .NET apps by building out a smart components ecosystem with the community and our control vendor partners.

AI Building Blocks for .NET

A robust ecosystem means there are more choices than ever for developers to decide on what is the perfect fit for their scenario. We looked at how we could streamline these integrations and remove the barrier of entry with the ever-growing number of APIs and functionality in the ecosystem. This is why, in collaboration with Semantic Kernel, we’ve introduced a set of abstractions to the .NET ecosystem under Microsoft.Extensions.AI and Microsoft.Extensions.VectorData which provide a unified layer of C# abstractions for interacting with AI services, such as small and large language models (SLMs and LLMs), embeddings, vector stores, and middleware. This new streamlined approach is already seeing great results from early adopters including Pieces and OllamaSharp.

Diagram explaining how AI extensions work

Tensors and Tokenizers

Microsoft.Extensions.AI and VectorData are only a subset of the building blocks we’re delivering in .NET 9 as we have also made great improvements to libraries and primitive types to improve AI development. Microsoft.ML.Tokenizers as improved tokenizer improvements for popular model families including GPT (4,o1,etc), Llama, Phi, and Bert in addition to new support for tokenization algorithms including Byte-Level BPE, SentencePiece, and WordPiece.

With the advent of language models as a service, the barrier to entry for developers using AI has drastically decreased. Tensor<T> also gets a boost for AI development with a new type to represent multidimensional data to simplify interop between libraries and applying operations

We can’t wait to see what you create with these new building block integrations. To get a jump start on these browse our AI documentation and AI samples for .NET.

GitHub Copilot Enhancements for .NET Developers

GitHub Copilot provides enhanced productivity by delivering improved results in editor experiences and offering AI assistance in regular workflows for .NET developers. This experience gets even better with the latest releases of Visual Studio and Visual Studio Code alongside updates for GitHub Copilot. Get up copilot and the IDEs have been infused with AI throughout to help you in every part of the developer lifecycle from writing code, to writing tests, to and to debugging your applications. Here are a few features you can look forward to in the latest release;

  • AI smart variable inspection: Optimize your debugging workflow with Integrated AI variable inspection. 

  • AI-powered IEnumerable visualizer: AI-powered LINQ Editable Expressions in the IEnumerable visualizer. 

  • Fix code with GitHub Copilot: GitHub Copilot assists you in resolving code issues. 

  • Better AI completions for C#: GitHub Copilot brings in additional context from relevant source files to improve completions for C#. 

  • Debug tests with GitHub Copilot: Get help with debugging failed tests by using Debug Tests with GitHub Copilot. 

Full stack web development with ASP.NET Core & Blazor

ASP.NET Core is our full stack web framework for .NET, providing everything you need to build modern web apps and scalable backend services. .NET is loaded with new features and notable performance, accessibility, and security improvements. ASP.NET Core apps built with .NET 9 are secure by default, have expanded support for ahead-of-time compilation, improved monitoring and tracing, and with the performance improvements built in you will see higher throughput, faster startup time, and all with less memory usage.

ASP.NET Core in .NET 9 - quality, dev experience, cloud native

Optimized handling of static files in ASP.NET Core

Static web assets, like JavaScript and CSS files are part of almost every web app. ASP.NET Core in .NET 9 now optimizes these files during build & publish for efficient deployment. During the build, ASP.NET Core identifies any static web assets and generates fingerprinted versions of these files by adding a content-based hash to the file name. The fingerprint ensures that the file name is unique, which avoids stale version of the file being used and enables the files to be aggressively cached. The files are also precompressed using Brotli when the app is published, which dramatically reduces their download size and avoids burdening the server with compression work. The files are handled at runtime using endpoint routing, which means you can now use other endpoint-aware features with your static files, like per-endpoint authorization.

Blazor improvements in .NET 9

Blazor is better than ever in .NET 9 to empower you to build beautiful modern web & hybrid apps. This release brings performance improvements across all areas of Blazor, a new Blazor Hybrid and Web app template, and new APIs for developers to create delightful experiences.

Blazor can now detect the component render mode at runtime using the new RendererInfo API and adjust component rendering accordingly. You can disable or hide interactive elements during prerendering and then enable them once the component is interactive.

@if (RendererInfo.IsInteractive)
{
    <button class="btn btn-primary" @onclick="IncrementCount">Click me</button>
}
else
{
    <p>One moment, please</p>
}

Blazor apps using interactive server rendering (Blazor Server) benefit from a new reconnection experience that has a friendlier UI, reconnects to the server faster, and automatically handles reloading the page if the user’s connection has been lost.

OpenAPI enhancements in ASP.NET Core

APIs built with ASP.NET Core power services across the planet at scale, and we have continued to improve the experience of building them every single release. A highlight in .NET 9 for API developers is the new built-in support for OpenAPI document generation using the Microsoft.AspNetCore.OpenAPI package. Metadata is extracted automatically from your app code, attributes, and extension methods. The document can then be customized further with transformers that operate on operations, schemas, or the document as a whole. In Minimal API apps, the feature is native AOT-friendly, empowering you to optimize your apps for the best performance. In addition to all of this, the OpenAPI document can be generated at build time and integrated into local development workflows and build pipelines that leverage OpenAPI tooling.

Diagram showing new API, document, and testing

Improved security in ASP.NET Core

Security continues to be central to ASP.NET Core and you will find several improvements to help ensure your apps are secure by default. It’s now easier to setup a trusted development certificate on Linux to enabling HTTPS during development. Blazor now has a built-in APIs for flowing the authentication state to the client, and extensibility for adding additional parameters to OAuth and OIDC authorization requests are available, as well as support for Pushed Authorization Requests (PAR). Finally, we have hardened ASP.NET Core’s data protection support and improved Kestrel’s connection metrics to make it easier to detect why a connection failed.

Overview of new features in ASP.NET Core in .NET 9

These are just some of the improvements in ASP.NET Core for .NET 9. For additional details on these features and more, see What’s new in ASP.NET Core for .NET 9.

.NET MAUI – Enhancing multi-platform app development

.NET MAUI is the definitive way to build multi-platform applications across mobile and desktop with .NET. In addition to a unified abstraction layer to access native features from a single API and create stunning cross-platform user interfaces from a single code base, .NET MAUI includes the foundation to build for Android, iOS, macOS, and Windows with access to native APIs in .NET. The top goal for .NET MAUI heading into .NET 9 has been to improve quality and reliability so you can more easily deliver your apps in production. In the last year, we’ve seen apps built with .NET MAUI more than double in the Google Play Store, developer usage has grown more than 30% to an all-time high, and community engagement and contributions have been amazing.

Image showing increase in usage and PRs on .NET MAUI

We recently welcomed to .NET MAUI the contributions of Syncfusion, a leading component vendor in the .NET ecosystem. Since Syncfusion began contributing to .NET MAUI this July through September they have accounted for more than 55% of all community contributions, which is also up 557% compared to the previous 3 months thanks to an already amazing group of contributions. In .NET 9, we are putting community front and center by introducing a brand-new project template that includes 14 free and open source Syncfusion controls and other popular libraries from the community that demonstrate recommended practices for MVVM, database access, navigation, view refresh, and other common app patterns. Use this to jump start your app development.

Gallery of mobile and desktop apps with .NET MAUI

We have been listening to developers and .NET 9 delivers enhanced performance, reliability, and deeper integrations for desktop and mobile applications. You will find sweeping performance improvements throughout .NET MAUI including a new implementation of CollectionView & CarouselView for iOS & Mac Catalyst, updates to existing controls and app lifecycle, and Native AOT and trimming enhancements empowering you to build smaller, faster apps. In addition to support for the latest iOS, macOS, and Android operating systems we have added in .NET 9 several native platform capabilities including Android Asset Packs, improved interop with native libraries, and streamlined integration between Xcode and Visual Studio Code via the new Xcode Sync dotnet tool.

Overview of .NET MAUI features in .NET 9

There is so much to love and explore in .NET MAUI with .NET 9.Be sure to comb through the what’s new documentation and give the new project template a try.

Windows Development with .NET 9

With .NET 9, your Windows apps will have access to the latest OS features and capabilities while ensuring they are more performant and accessible than ever before. Whether you are starting a new modern app with WinUI 3 and the Windows App SDK or modernizing your existing WPF and WinForms applications, your Windows apps run best on .NET 9. We have been collaborating closely with the Windows developer community to bring features that you have been requesting. This includes Native AOT support for WinUI 3 for smaller and more performant apps, modern theming enhancements with Fluent UI for WPF, and WinForms gets a boost with a new Dark Mode, modern icon APIs, and improved asynchronous API access with Control.InvokeAsync.

Overview of Windows Developer features in .NET 9

There is a lot more to explore in .NET 9 for Windows development so be sure to read through the what’s new documentation for WinUI 3, WPF, and WinForms.

C# & F# – Your Favorite Programming Languages Get Even Better

C# is one of the most popular and loved programming languages in the world. In C# 13 we focused on features that make it easier, safer, and faster for you to write code in the styles you know and love. The use of the params modifier in method signatures gets a boost in C# 13 with the addition of collections expressions. This means you are no longer limited to using array types with params and can use any supported collection type!

C# 13 unlocks even more high-performance code by introducing new ways to use ref struct values and makes it easier to work with multi-threaded applications with System.Threading.Lock:

Lock myLock = new();

void Concat<T>(params List<T> items)
{
    lock (myLock)
        Console.WriteLine(string.Join("\e[1mItem: \e[0m", items));
}

F# continues to deliver the finest functional programming for .NET developers. F# 9 brings a variety of language, library, and tooling enhancements designed to make your programs safer, more resilient, and performant. Nullable reference types bring type safety to interactions with C# libraries, optimized integral ranges speed up for loops and other comprehensions, and optimized equality checks avoid boxing and increase the performance of many common operations. Discriminated unions get autogenerated .Is* properties for quick case testing. The standard library now includes random functions for collections, which come in handy for data science and game development. Developer productivity gets a boost from improved diagnostics, parser recovery, and various tooling improvements.

// FS3261: Nullness warning: The types 'string' and 'string | null' do not have equivalent nullability.
let methodArgument (s: string | null) = File.Create s
let matchNullableString(s: string | null) =    
        match s with  // `s` is of type string | null
        | null -> 0
        | notNull -> notNull.Length // `notNull` is of type string

There are so many more features that we know you are going to love so be sure to browse the what’s new in C# 13 documentation and what’s new in F# 9 documentation. If you are starting your C# development journey, be sure to check out the Foundation C# Certification in partnership with freeCodeCamp.

World’s Best Developer Tools

Today’s release of .NET 9 is accompanied by updates to our developer tools to make you more productive than ever. First, the release of Visual Studio 2022 17.12 brings with it a suite of productivity improvements throughout all aspects of your developer workflow with a big performance boost, enhanced debugging & diagnostics experiences, tighter integration with .NET Aspire, deeper cloud integrations, analyzer support for C# 13, enhanced Git support, and so much more! In fact, this release of Visual Studio 2022 has more user-requested features than ever before. There is something for everyone in this release and we know you are going to love it.

C# Dev Kit for Visual Studio Code continues to evolve with improved editing reliability, NuGet package management, enhanced test adapter and code coverage results, improved .NET MAUI development support, and upgraded project launch/debug configurations. Download the latest versions of Visual Studio 2022 and C# Dev Kit for Visual Studio Code to benefit and improve your developer workflows today.

We know that developers love the CLI, and we are always looking to improve the .NET CLI experience and help make it part of a secure development approach. In .NET 9 we have made sweeping improvements to the terminal logger including clickable links, duration timers, color coding, and more. The output from the logger is more condensed and you will now find summaries of the total count of failures and warnings at the end of the build making it more usable than ever.

.NET CLI showing new feature highlighting

There is so much more in the .NET SDK that that you will love, so be sure to read through the what’s new documentation.

A Flourishing Community of Creators & Contributors

We love the amazing .NET community and without your support and contributions, .NET 9 would not have been possible. There were over 26,000 contributions from over 9,000 community members! Thank you for every single issue, comment, code review, and pull request that you made to help make this the best release of .NET yet. We also love your love for .NET and ranking .NET as the most admired framework along with ASP.NET Core and C# as top web frameworks and programming languages on this year’s Stack Overflow developer survey. Thank you for helping build this astonishing global community of developers.

Image that says thank you with avatars in background

Thank you to all library creators who have helped make the ecosystem around .NET flourish and make NuGet the fastest growing package ecosystem year over year. There are now over 420 thousand packages for .NET developers to consume and they have been downloaded over 570 billion times, which is astonishing. We are investing deeply to improve NuGet with features developers love and work to make it the most secure package ecosystem on the planet.

Overview of NuGet ecosystem

NuGet brings major improvements for both library creators and consumers across the ecosystem. There is a fresh new look on NuGet.org, now with dark mode, partnered with GitHub to add native NuGet support to Dependabot, support for open-source scorecards and pinned dependencies with OpenSSF, and enhanced integration with deps.dev to get more insight into dependencies in your project.

New features in this release bring enhanced security for our package ecosystem for .NET developers. dotnet restore has also been updated to audit top-level and transitive dependencies for package vulnerabilities. This capability pairs well with Central Package Management, enabling you to quickly deploy package upgrades to all projects within a repo. `dotnet restore` alerts you in your terminal, Visual Studio, and CI/CD pipeline, driven by package vulnerabilities in the GitHub Advisory Database.

The new audit behavior will produce new warnings, which will be important to developers that have projects with “treat warnings as errors” enabled. We encourage everyone to read the updated NuGet package auditing improvements documentation.

Start Building with .NET 9 Today

Downloads of .NET 9 and updates to Visual Studio 2022 and the C# Dev Kit for Visual Studio Code are available now.

Go deeper on everything new in this release with on-demand sessions from .NET Conf 2024 and the latest documentation for every part of .NET 9:

Additionally, we will be posting deep dive blogs posts over the next several months on new features across all of .NET 9 including languages, workloads, and tools, so be sure to subscribe to the .NET Blog so you get notified when new blogs go live.

We can’t wait to see what you build with .NET 9.

Author

.NET is the free, open-source, cross-platform framework for building modern apps and powerful cloud services.

27 comments

  • Alexander Baggett

    I'm glad to see the excellent performance updates from the .Net Team. Great work, truly.

    However, as a Microsoft stack web developer, I'm concerned that .Net's progress is being undermined by significant issues across multiple products. For example, in EFCore 8:

    We're also experiencing concerning performance issues with Azure Event Hubs, with event processing times reaching up to 45 seconds despite months of engagement with Azure escalation support. This makes real-time scenarios impractical.

    These issues are particularly impactful...

    Read more
  • Siavash Mortazavi

    The diagram on top does not show iOS and Android as target OS’s, but MAUI can target them…

  • Mike M · Edited

    Great to see new Windows 11 theme for WPF apps running on .NET 9
    Also, a lot improvements to Entity Framework Core

  • Jon Miller 1 week ago

    Please abandon Recall. Will be abandoning Windows next year when 10 support is dropped otherwise. Along with .NET and switching to Python. Been a Windows user and developer since 1990. You are beyond pushing your users too far at this point. You are going way overboard on forcing AI and the cloud on everyone. Look forward to an exodus of other people abandoning your platform.

    • anonymous 6 days ago

      this comment has been deleted.

    • Newton Dantas 7 days ago

      I’m also a Windows user and developer since 1990 and I completely disagree with you.

    • neon-sunset

      .NET has no relation to Windows or Windows features. It’s not a Windows product. It’s like asking Golang’s team to change YouTube policies.

      • JianBo He 6 days ago

        Windows 8 joke of a UI…… hahahaha

      • Jon Miller

        Maybe not Recall, but, placing all emphasis on cloud an AI is. Regardless, if Microsoft jams Recall down everyone's throats like they have done with numerous other annoying features that no one asked for or wanted (Windows 8 joke of a UI, Cortana, etc. etc.), expect many people dumping Windows. Trying to advocate this platform to anyone at this point is an embarrassment. Microsoft makes all it's decisions on high and could care less what...

        Read more
  • Ali Aslan 1 week ago

    There used to be separate blog posts for new versions of technologies like ASP.NET Core and MAUI. For version 9 they don’t have separate posts. Why is that?

  • Balen (BalenCPP) 1 week ago

    This is a big release! I thank and appreciate everyone involved in the development of .NET. It’s my overall favorite runtime and environment to program in by far, and I am glad it’s continuously getting better.

  • Mike Diack 1 week ago

    Can you clarify – as I’ve not seen it anywhere, what the system requirements are (OS and build level) to run .Net 9?

    .Net 8 was: .Net 8 supports Windows 10 (build 14393 and later) and Windows 11

    BUT I can’t find anywhere what the system requirements for .Net 9 are?

    • Gauthier M. 1 week ago · Edited

      https://github.com/dotnet/core/blob/main/release-notes/9.0/supported-os.md

      Windows
      OS Versions Architectures Lifecycle
      Nano Server 2022, 2019 x64 Lifecycle
      Windows 11 24H2 (IoT), 11 24H2 (E), 11 24H2, 11 23H2, 11 22H2 (E), 10 22H2, 10 21H2 (E), 10 21H2 (IoT), 10 1809 (E), 10 1607 (E) Arm64, x64, x86 Lifecycle
      Windows Server 23H2, 2022, 2019, 2016, 2012-R2, 2012 x64, x86 Lifecycle
      Windows Server Core 2022, 2019, 2016, 2012-R2, 2012 x64, x86 Lifecycle

  • Jorge Morales Vidal

    This is why the comment section gets disabled, the meanness and lack of empathy when posting.

  • Jason Baginski

    Silly thing, but much appreciated and I owe someone a beer.

    In VS 17.12.0, when I click on each transitive package in Manage NuGet Packages. The Version combobox says "Latest stable" when it is. This simple change saved me a huge number of clicks. Rather than having to click a package, then go click on the combobox, then scroll up to the top. Now I just click on each package once down the...

    Read more
  • van leroy

    Please what does it mean by for hundreds of thousands