Microsoft officially only supports C# 13.0 newer than .NET 9.0 (“C# 13.0 is only supported on .NET 9 and newer versions.”).
Advertisement

Dr. Holger Schweitenberg is the technical director of the expert network www.IT-Visions.de, which supports many medium-sized and large companies through consulting and training as well as software development with 53 renowned experts. Through his attendance at numerous national and international conferences as well as more than 90 expert books and more than 1,500 expert articles, Holger Schwittenberg is one of the best-known experts for .NET and web technologies in Germany.
C# 13.0 in older .NET versions
However, most of the language features of C# can also be used in older .NET versions, including .NET Framework, .NET Core, and Xamarin. To do this you need to check the compiler version used per tag
Until “13.0” in the project file (.csproj).
13.0
For language features to work in versions prior to .NET 9.0, they must not have dependencies on base library classes introduced in .NET 9.0. unless you
In the project file, the following new language features of C# 13.0 are possible in earlier versions:
- Partial properties and partial indices
- Common set associated with params keyword
- innovation for
ref struct
Except for use as a type argument - escape character
\e
However, it should be noted that there is no technical support from Microsoft for the use of new language features in .NET versions prior to 9.0, so you cannot use the support agreement to ask Microsoft for help if you have problems. Can do. Nevertheless, using higher C# versions in older .NET projects is a common and problem-free practice in some companies.
Stable new language features in C# 13.0
The following new language features have appeared in C# 13.0, which I will discuss in this blog series in the coming weeks:
- partial attributes and partial indexes,
- new escape character
\e
For ANSI/VT100 terminal control escape sequences, - Preferences for method overloading,
- common set type
params
, - Object initialization with index operator from end,
- new class
Threading.Lock
Forlock
-instructions and - extension for
ref structs
(on the stack).
Experimental Language Feature in C# 13.0
Another language feature has been included in C# 13.0 in experimental form: semi-automatic properties with new keywords. field
This keyword is only available in the project file
Or
set.
New language features postponed
The following language features were planned for C# 13.0 and some were already available as prototypes, but were then released C# 14.0 postponedWhich is scheduled to release in November 2025:
- tuple deconstruction
(int x, string y) = default
instead of(default, default)
- automatic conversion between
Array
,Span
AndReadOnlySpan
- Extensions: A more developed, generalized form of extension methods in which you can add not only instance methods, but methods and properties at both the instance and class level (“static”). Microsoft wants new keyword for this
extension
introduce.
Breaking changes in C# 13.0
there are some some breaking changes Compiler behavior in C# 13.0 compared to C# 12.0. However, these are special cases of less importance, such as restrictions on annotations. (InlineArray)
But record struct
,
(rme)
