New Release of C# 13 and .NET 9: Overview of Key Changes and Innovations

Online Python Trainer for Beginners

Learn Python easily without overwhelming theory. Solve practical tasks with automatic checking, get hints in Russian, and write code directly in your browser — no installation required.

Start Course

New release of C# 13 and .NET 9: key changes and innovations



The Microsoft team has officially announced the release of the long-awaited update to the .NET 9 platform and the C# 13 programming language. The new release brings many improvements aimed at increasing performance, simplifying code writing, and expanding capabilities for modern web, mobile, and desktop applications. Let's break down the main changes that every developer should know.



What's new in C# 13?



The C# language continues to evolve, and version 13 is no exception. Here are the main innovations:



  • Collection Expressions: Now you can create and initialize collections (lists, arrays, dictionaries) even more concisely. The [] and [:] syntax simplifies working with immutable collections and Span.
  • Improved Lambda Expressions and Closures: The compiler has become smarter in determining types for lambdas, which reduces the number of unnecessary casts and makes code cleaner.
  • New Interface Capabilities: Support for static abstract members in interfaces has been added (improved work with generic algorithms).
  • Pattern Matching: New patterns have been added for working with tuples and lists, which is especially useful when processing data.
  • Primary Constructors: This feature from C# 12 has been improved: now primary constructors can be used not only in record types, but also in regular classes and structs.


Key improvements in .NET 9

The .NET 9 platform has received a major upgrade in performance and tools. Let's look at the main points:



  • Performance: The JIT compiler (RyūJIT) has been optimized for ARM64 and x64. According to Microsoft's tests, the speed increase in some scenarios reaches 15-20%. Memory operations and loops have been accelerated.
  • Native AOT (Ahead-of-Time) Compilation: Support for AOT compilation has been improved, allowing you to create even more compact and fast-starting applications without JIT. This is critical for cloud services and microservices.
  • ASP.NET Core: Work with SignalR, WebSockets, and minimal APIs has been optimized. Built-in support for OpenAPI v3.1 has been added.
  • LINQ: New methods for working with collections have appeared in LINQ, such as CountBy, AggregateBy, and Index. They simplify grouping and statistics calculation.
  • System.Text.Json: Serialization has been improved: support for polymorphism without additional attributes has been added, and work with large JSON documents has been accelerated.
  • Security: Protection mechanisms against vulnerabilities related to deserialization and buffer overflow have been strengthened.


What does this mean for developers?



Moving to C# 13 and .NET 9 is not just a version update. It is a step towards more efficient and secure code. Developers get:



  • Reduced task execution time due to JIT and AOT optimization.
  • More readable and concise code thanks to new syntactic capabilities.

Recommended Libraries