NET 9, the most efficient, modern, secure, intelligent and high-performance version of .
The new release is a collaborative effort of thousands of developers around the world and includes thousands of performance, security, and functionality improvements.
Key Highlights
- Performance Improvement: Overall improved performance and reduced memory usage.
- Security Enhancement: Significant security improvements.
- AI Support: Easily integrate AI into applications.
- Comprehensive improvements: covering programming languages, development tools and workloads to provide a unified development platform.
NET Conf 2024 Conference
NET Conf 2024 Join us for free at our three-day virtual developer conference (November 12-14) for an in-depth look at the new features of .NET 9.
Address:/
Let's take a look at the highlights of the new features and tools added in .NET 9.
NET 9 Runtime Performance Improvements, Lower Memory Usage
NET 9 is the highest-performing version of .NET to date, with more than 1,000 performance-related improvements and more efficient algorithms to produce better code.
Stephen Toub discusses these improvements in depth and is worth reading.
- Server GC Optimization
Server GC now adjusts to the actual memory requirements of the application, rather than relying on the resources (memory and CPU) in the environment. This change is particularly applicable to high core count environments, especially if the application's memory requirements are small or highly variable over time.
This new GC implementation reduces memory usage, but may have a slight throughput cost. Users may choose to configure server GC to use the older implementation for testing purposes.
- performance enhancement
TechEmpower benchmarks show a significant increase in throughput for .NET 9, along with a significant decrease in memory usage, largely due to server GC optimizations.
- Vectorization and hardware support
NET 9 returns to vectorization, adding support for new chips such as Arm64 SVE, Intel AVX10, and hardware accelerated runtimes.
- RyuJIT Performance Improvement
RyuJIT improves performance of Arm64, loops, PGOs and boundary checks. Exception handling has been improved by 50%.
- Dynamic PGO Updates
Dynamic Profile Guidance Optimization (PGO) updated to optimize more code patterns. jit generates fast-path code for common type conversions, resulting in 70% faster execution, but requires ReadyToRun to be disabled.
- LINQ Optimization
LINQ methods such asTake
cap (a poem)DefaultIfEmpty
Returns 10x faster on empty collections. pass (a bill or inspection etc)
Enables efficient iteration and vectorization, now supports
List<T>
。
- make superior
The performance of the various operations has been improved by more than 50 percent.
Write directly to UTF8 bytes to reduce string allocation.
New APIJsonMarshal.GetRawUtf8Value
substitute for, avoiding additional coding and distribution.
JsonObject
Optimized memory allocation and resizing costs.
NET Aspire - Basic Components for Developing Better Applications
NET Aspire is a powerful set of tools, templates and packages for the seamless development of observable, production-ready applications.
In the six months since the initial release, we've made improvements to all parts of the stack, including new features for telemetry and metrics dashboards, and simpler cloud application deployment.
new feature
Start and stop resources from the dashboard.
Keep the container active between debugging sessions.
New APIs, such as WaitFor, to better manage resource startups.
new integration
Seamless integration with OpenAI, Ollama, Milvus and more.
Simplified access
Easier integration of .NET Aspire into applications.
Improved deployment options for Azure containerized applications.
Preview supports Azure Functions.
widely used
Microsoft Internal: The Xbox and Copilot teams have integrated .NET Aspire into their existing services, tightening the internal development loop with easily accessible insights and Azure integration.
Community: .NET Aspire is widely adopted and the community actively participates and contributes new tools and integrations.
Artificial Intelligence - Evolving and Progressing AI Ecosystems
NET capabilities continue to expand to help us infuse AI, with major advances including:
Learning materials and examples
Provide new learning materials and examples to simplify integration with ecosystems.
Partners and Communities
Build a robust AI ecosystem with partners such as Azure, OpenAI, LlamaIndex, Qdrant, Pinecone, Milvus, AutoGen, OllamaSharp, ONNX Runtime and more.
Work with the community and control vendors to build an ecosystem of smart components that make AI integration easier.
Industry Adoption
Companies like H&R Block, Blip, and KPMG have built top-notch AI experiences using .
NET support for GitHub Copilot and the new Microsoft Copilot experience.
Seamless deployment
Deploying AI solutions to the cloud just got more seamless.
AI Ecosystem Extensions in .NET 9
A robust ecosystem means that developers have more options to determine the scenarios that work best for them. To simplify these integrations and lower the barriers to entry, we've partnered with Semantic Kernel on the cap (a poem)
A set of abstractions has been introduced under to provide a unified C# abstraction layer for interacting with AI services. These abstractions support small and large language models (SLM and LLM), embedding, vector stores, and middleware. Early adopters such as Pieces and OllamaSharp have benefited from this new simplified approach.
Tensor and disambiguator
In .NET 9, we made significant improvements to libraries and primitive types to improve AI development:
Tensor:Introduced a newTensor<T>
type for representing multidimensional data, simplifying interoperability between library and application operations.
Splitters: Multiple tokenization algorithms are supported, including byte-level BPE, SentencePiece, and WordPiece.Improved tagger support for popular model families such as GPT (4, o1, etc.), Llama, Phi, and Bert.
Lowering the threshold of entry
With the rise of Language Models-as-a-Service, the barrier to entry for developers using AI has been significantly lowered. These new building blocks we offer are designed to help developers integrate and use AI services more easily.
Quick Start
If you are interested, you can visit
AI Documentation:/dotnet/announcing-dotnet-9/
AI Examples for :/dotnet/announcing-dotnet-9/
GitHub Copilot Enhancements for .NET Developers
GitHub Copilot dramatically increases productivity by improving the editor experience and providing AI help to .NET developers in their regular workflow.
The latest versions of Visual Studio and Visual Studio Code, as well as updates to GitHub Copilot, bring the following new features:
- AI Intelligent Variable Checking
- Optimize debugging workflows with integrated AI variable checking.
- AI-Driven IEnumerable Visualization Tools
- Provides AI-driven LINQ editable expressions in the IEnumerable visualization tool.
- Repairing Code with GitHub Copilot
- GitHub Copilot helps solve code problems.
- Better C# Artificial Intelligence Completion
- GitHub Copilot improves C# completions by introducing additional context from related source files.
- Debugging Tests with GitHub Copilot
- Get help debugging failed tests with GitHub Copilot's Debugging Tests feature.
Core and Blazor for Full-Stack Web Development
Core is a .NET full-stack Web framework that provides everything you need for modern Web applications and scalable back-end services.
NET 9 brings new features and significant performance, accessibility, and security improvements.
Optimize static file handling
Optimize static web resources (such as JavaScript and CSS files) during build and release, generating fingerprinted versions by adding content-based hashes to filenames to ensure that filenames are unique and outdated versions are avoided.
Use Brotli pre-compressed files when distributing to reduce download size and ease the burden on your server.
Use endpoint routing to handle static files and support advanced features such as per-endpoint authorization.
Blazor improvementsperformance enhancement
-
Performance has improved in all areas.
-
New Blazor hybrid and web application templates.
-
The new API enables developers to create smoother user experiences.
Component Rendering Mode Detection
-
utilization
RendererInfo
The API detects component rendering modes at runtime, disables or hides interactive elements during pre-rendering, and enables them after component interaction.
Reconnecting the Experience
-
Blazor Server applications benefit from a friendlier UI, faster reconnections, and automatic handling of page reloads when connections are lost.
OpenAPI Enhancements
Built-in OpenAPI support
-
utilization
The package automatically generates OpenAPI documentation, with metadata extracted from application code, properties and extension methods.
-
Supports customization of operations, modes, or entire documents.
-
Native AOT support in Minimal API applications to optimize performance.
-
OpenAPI documentation is generated at build time and integrated into the local development workflow.
Safety ImprovementsDeveloping certificate settings
-
Easier setup of trusted development certificates to enable HTTPS on Linux.
Authentication State Transfer
-
Blazor provides a built-in API for transferring authentication status to the client.
OAuth and OIDC Support
-
Support for adding additional parameters to OAuth and OIDC authorization requests, as well as support for Push Authorization Requests (PARs).
Data protection and connectivity indicators
-
Enhanced data protection support.
-
Improve Kestrel's connection metrics to make it easier to detect the cause of connection failures.
NET MAUI - Enhanced Multi-Platform Application Development
NET MAUI is the ultimate tool for building multi-platform applications across mobile and desktop using .
The main goal of .NET 9 is to improve quality and reliability, making it easier for you to deliver applications in production.
Community participation and contribution
-
Double the number of apps in the Google Play store built with .NET MAUI.
-
Developer utilization increased by more than 30%, reaching an all-time high.
-
Community participation and contributions have increased significantly.
-
Syncfusion has been contributing since July through September of this year and accounts for 55% of all community contributions, a 557% increase over the previous 3 months.
New project template
-
Introducing new project templates with 14 free open source Syncfusion controls and other popular community libraries.
-
Demonstrations of MVVM, database access, navigation, view refresh, and other recommended practices to help jump-start application development.
Enhanced performance and reliability
-
NET MAUI, including new implementations for iOS and Mac Catalyst.
CollectionView
cap (a poem)CarouselView
。 -
Update existing controls and application lifecycles to support native AOT and pruning enhancements to build smaller, faster applications.
Platform Support
-
Supports the latest iOS, macOS and Android operating systems.
-
A variety of native platform features have been added, such as the Android Asset Pack, improved interoperability with native libraries, and simplified integration between Xcode and Visual Studio Code through the new Xcode dotnet tool.
Windows Development with .NET 9
NET 9 Windows applications will be able to access the latest operating system features and functionality while ensuring higher performance and accessibility. NET 9 provides the best support for building new modern applications using WinUI 3 and the Windows App SDK, or modernizing existing WPF and WinForms applications.
WinUI 3
Native AOT support for smaller, higher performing applications.
WPF
Fluent UI Modern theme enhancements to improve the user interface experience.
WinForms
Added dark color mode, modern icon APIs, and improved asynchronous API access (e.g. ).
What's New in C# 13 and F# 9
C# 13 is focused on enabling us to write code easier, safer, and faster.
set expression (math.)
The params modifier now supports any supported collection type, not just arrays.
High Performance Code
Unlock higher performance code and easier multithreaded applications by using ref struct and .
Lock myLock = new(); void Concat<T>(params List<T> items) { lock (myLock) (string.Join("\e[1mItem: \e[0m", items)); }
F# 9 continues to provide the best functional programming experience for .NET developers.
Key improvements include:
nullable reference type (computing): Interaction with C# libraries is more type-safe.
Optimized integer range: Speed up loops and other derivatives.
Optimized equality check: Avoid crating and improve the performance of common operations.
automatic.Is*
causality: Provide rapid case testing for discriminated against unions.
Standard Library Enhancements: Randomized functions containing sets, for data science and game development.
Improved diagnostics and tools: Increase developer productivity.
// FS3261: Nullness warning: The types 'string' and 'string | null' do not have equivalent nullability. let methodArgument (s: string | null) = s let matchNullableString(s: string | null) = match s with | null -> 0 | notNull -> // notNull is of type string
NET 9 Development Tools Update
NET 9 comes with several development tool updates designed to make developers more productive.
Visual Studio 2022 17.12
-
performance enhancement: Significantly improve performance and increase development efficiency.
-
Debugging and Diagnostics: Enhanced debugging and diagnostic experience.
-
NET Aspire IntegrationNET Aspire: tighter integration with .
-
converge: more in-depth cloud integration.
-
C# 13 Support: Support for new features in C# 13.
-
Git Support: Enhanced Git support.
-
user request function: Functions that contain a large number of user requests.
C# Development Kit for Visual Studio Code
-
Editorial reliability: Improve editorial reliability.
-
NuGet Package Management: Enhanced NuGet package management.
-
Test Adapter: Enhanced test adapter and code coverage results.
-
NET MAUI SupportNET MAUI development support.
-
Project startup/debugging: Upgraded project startup and debug configuration.
NET CLI Improvements
-
terminal recorder: Overall improvements to the terminal recorder, including clickable links, continuous timers and color coding.
-
Concise Output: The logger output is more concise, providing a summary of the total number of failures and warnings.
-
Package Audit:
dotnet restore
Updated to audit top-level dependencies and package vulnerabilities in passing dependencies. -
Centralized package management: Works perfectly with centralized package management to quickly deploy package upgrades to all projects.
-
Vulnerability Alerts: Provides package vulnerability alerts in Terminal, Visual Studio, and CI/CD pipelines, driven by the GitHub Advisory Database.
Experience .NET 9 content now!
NET 9 and updates to the C# Development Kit for Visual Studio 2022 and Visual Studio Code are now available.
download link
- .NET 9
- /download/dotnet/9.0
- Visual Studio 2022 v17.12
- /downloads/
- Visual Studio Code C# Development Kit
- /items?itemName=
Learn about the new features
- What's New in .NET 9
- /dotnet/core/whats-new/dotnet-9
- What's New in C# 13
- /dotnet/csharp/whats-new/csharp-13
- What's New in F# 9
- /dotnet/fsharp/whats-new/fsharp-9
- What's New in Core
- /aspnet/core/release-notes/aspnetcore-9.0
- What's New in .NET Aspire
- /dotnet/aspire/whats-new
- What's New in .NET MAUI
- /dotnet/maui/whats-new/dotnet-9
- What's New in EF Core
- /ef/core/what-is-new/ef-core-9.0
- What's New in WPF
If you found this article helpful, why not support it with a like? Your support is what keeps me motivated to continue sharing my knowledge. Feel free to leave a comment if you have any questions or need further help.
You can also join WeChat[DotNet Technician] community to share ideas and grow with other tech-loving peers!Excellence is a habit, so feel free to leave a comment and learn!
Translation:/dotnet/announcing-dotnet-9/