Skip to content
Tutorials Center
My learning

Topics

C# Reference ยท .NET, Tools and Concepts

What is new in C# 14

A feature tour of C# 14 on .NET 10: extension members, the field keyword, null-conditional assignment, implicit span conversions, partial constructors and more.

C# 14 shipped in November 2025 with .NET 10, a long-term-support release. It is the default language version for projects that target net10.0, and it is the version this site's runner compiles. The release removes several small points of friction instead of adding one large feature: properties with a little custom logic, extension methods that cannot be properties, and null checks around assignments.

This page is a quick reference for each feature. For longer walk-throughs and discussion of corner cases, read the lesson C# 14 Features in Depth.

C#
public string Name { get; set => field = value.Trim(); } = "";

customer?.Name = "Ada";

extension(string text)
{
    public bool IsBlank => string.IsNullOrWhiteSpace(text);
}

Try it

C# Extension members and the field keyword

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with Console.ReadLine()), it gets the next line from this box.

C# Null-conditional assignment, lambda modifiers, compound operators

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with Console.ReadLine()), it gets the next line from this box.

Feature tour

Extension members

An extension(receiver) block declares members for a type, including properties and static members, not only methods. The receiver parameter goes in the block header and applies to all instance members inside it. A block with only a type (extension(string)) holds static members that appear on the type itself. The older this syntax is still fully supported and compiles the same way. See Extension members.

The field keyword

Inside a property accessor, field refers to the compiler-generated backing field. You can write get; with a custom set, or a custom get with a plain set;, and never declare the private field yourself. If your class already has a member named field, write @field or this.field to mean your member. See field.

Null-conditional assignment

a?.B = value and a?[i] = value assign only when a is not null, and then the right-hand side is evaluated. It works with compound assignment such as +=, but not with ++ or --. The expression has no value you can use.

Implicit span conversions

Arrays convert implicitly to Span<T> and ReadOnlySpan<T>, string converts to ReadOnlySpan<char>, and these conversions take part in overload resolution, generic inference and extension method lookup. Code that was awkward with spans, such as calling an extension on an array that takes a ReadOnlySpan<T>, now just works. See Span and Memory.

nameof with unbound generics

nameof(List<>) is allowed and gives "List". You no longer need to write a dummy type argument.

Lambda parameter modifiers

You may use ref, in, out, scoped and ref readonly on lambda parameters without writing the type, as long as the delegate type is known from the target. In the example the parameter types come from TryDouble.

Partial constructors and events

A partial class may declare a constructor in one part and implement it in another, and likewise for events. This extends the partial members of C# 13 and is aimed at source generators.

User-defined compound assignment

A type can define operator += (also -=, *=, /=, %=, &=, |=, ^=, <<=, >>=, ++ and --) as an instance method that modifies the object in place. For large mutable types, such as a big-number buffer or a matrix, this avoids allocating a new object for every operation. When no compound operator exists, x += y still falls back to x = x + y.

Usage notes

  • field breaks name clashes. If a class has a field called field, accessors that used it now refer to the backing field. The compiler warns when the meaning changes.
  • Do not overuse null-conditional assignment. It silently does nothing for null receivers, so it hides bugs where the object should never be null.
  • Extension blocks compile to static methods, so they cannot access private members and do not add state to the type. An instance member always wins over an extension of the same name.
  • User-defined += must be an instance method with a void return type that mutates this. Keep the result consistent with what x = x + y would produce, or callers will be surprised.
  • Language version: none of these features compile with <LangVersion>13</LangVersion> or earlier.
  • Library support: C# 14 itself runs on older runtimes in many cases, but .NET 10 is the supported combination.