DEV Community

IronSoftware
IronSoftware

Posted on

What's New in C# 14?

C# 14 dropped with .NET 10 in November 2025. New syntax. Performance wins. Quality-of-life improvements developers actually wanted.

Here's everything new in C# 14, with practical examples.

When Was C# 14 Released?

November 11, 2025 alongside .NET 10 LTS.

// C# version history
// C# 12: .NET 8 (November 2023)
// C# 13: .NET 9 (November 2024)
// C# 14: .NET 10 (November 2025) ← Current
Enter fullscreen mode Exit fullscreen mode

Supported until November 2028 as part of .NET 10 LTS.

What Are the Major Features?

Extension Members

Extend types with properties, not just methods:

// Before C# 14: Extension methods only
public static class StringExtensions
{
    public static int WordCount(this string str) =>
        str.Split(' ').Length;
}

// C# 14: Extension properties too
public static class StringExtensions
{
    public static int WordCount(this string str) =>
        str.Split(' ').Length;

    // NEW: Extension property
    public static bool IsEmail(this string str) =>
        str.Contains("@") && str.Contains(".");
}

// Usage
"test@example.com".IsEmail; // true
"hello world".WordCount;     // 2
Enter fullscreen mode Exit fullscreen mode

Finally! Properties feel natural for computed values.

Field-Backed Properties

No more explicit backing fields:

// Before C# 14
private string _name;
public string Name
{
    get => _name;
    set => _name = value?.Trim();
}

// C# 14: Use 'field' keyword
public string Name
{
    get => field;
    set => field = value?.Trim();
}
Enter fullscreen mode Exit fullscreen mode

The compiler generates the backing field. Less boilerplate.

Null-Conditional Assignment

Assign only if not null:

// C# 14: Null-conditional on left side of assignment
customer?.Order = GetCurrentOrder();

// Equivalent to:
if (customer != null)
{
    customer.Order = GetCurrentOrder();
}
Enter fullscreen mode Exit fullscreen mode

GetCurrentOrder() only runs if customer isn't null. Prevents unnecessary calls.

File-Scoped Types

Limit type visibility to one file:

// MyClass.cs
file class InternalHelper
{
    public static void DoWork() { }
}

public class MyClass
{
    public void Process()
    {
        InternalHelper.DoWork(); // OK in this file
    }
}

// OtherClass.cs
public class OtherClass
{
    public void Process()
    {
        InternalHelper.DoWork(); // ERROR: Not visible here
    }
}
Enter fullscreen mode Exit fullscreen mode

Perfect for helper classes that should stay private to a file.

Unbound Generic Types in nameof

// Before C# 14: Had to specify type parameter
var name = nameof(List<int>); // "List"

// C# 14: Can use unbound generics
var name = nameof(List<>); // "List"
Enter fullscreen mode Exit fullscreen mode

Cleaner when you don't care about the type argument.

Partial Constructors and Events

Split constructors across files:

// MyClass.cs
public partial class MyClass
{
    public partial MyClass(string name);
}

// MyClass.Generated.cs
public partial class MyClass
{
    public partial MyClass(string name)
    {
        // Implementation can be in different file
        Name = name;
    }
}
Enter fullscreen mode Exit fullscreen mode

Useful for source generators.

Lambda Parameter Modifiers

Add modifiers without explicit types:

// C# 14: Modifiers on simple lambdas
var process = (scoped ref int x) => x *= 2;

// Before: Needed explicit type
var process = (scoped ref int x) => x *= 2;
Enter fullscreen mode Exit fullscreen mode

More flexibility for performance-critical code.

What's the Performance Impact?

49% faster server throughput vs .NET 8 (Microsoft benchmarks).

Core libraries already use C# 14 features. Your code gets faster even without changes:

// BCL methods now use C# 14 internally
var numbers = new List<int> { 1, 2, 3 };

// Faster iteration, better codegen
foreach (var n in numbers)
{
    Console.WriteLine(n);
}
Enter fullscreen mode Exit fullscreen mode

What About File-Based Apps?

C# 14 supports single-file scripts:

#!/usr/bin/env dotnet-script

Console.WriteLine("Hello from C# script!");
Enter fullscreen mode Exit fullscreen mode

Run directly: ./script.cs

Competes with Python, Node.js for scripting tasks. No project file needed.

Are There Breaking Changes?

Minimal. C# 14 is additive. Existing code compiles unchanged.

Watch out for:

  • field is now a contextual keyword in property accessors
  • New overload resolution rules (rare edge cases)

How Do I Enable C# 14?

.NET 10 SDK auto-enables C# 14:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net10.0</TargetFramework>
    <!-- C# 14 is default -->
  </PropertyGroup>
</Project>
Enter fullscreen mode Exit fullscreen mode

Older .NET versions: explicitly set <LangVersion>14</LangVersion> (some features require .NET 10 runtime).

What Didn't Make It?

Discriminated unions - Planned for C# 15 (November 2026).
Roles/extension interfaces - Still under consideration.
Primary interfaces - Deferred.

Community wanted unions badly. Almost made it, but needs more design work.

How Does This Compare to C# 13?

C# 13 (November 2024):

  • Params collections
  • Lock object improvements
  • Index from end operator ^

C# 14 adds:

  • Extension properties
  • Field-backed properties
  • Null-conditional assignment
  • File-scoped types

C# 14 is evolution, not revolution.

Should I Upgrade?

Yes, if:

  • You're on .NET 8 or older (performance alone justifies it)
  • You want LTS support (3 years)
  • You need extension properties

Wait if:

  • You're on .NET 9 (STS) and want to skip to .NET 11 (next STS)
  • Legacy dependencies block .NET 10

What Are Developers Saying?

Positive:

  • Extension properties finally!
  • Field-backed properties reduce boilerplate
  • Performance gains are real

Mixed:

  • Unions postponed (disappointment)
  • Incremental, not groundbreaking
  • File-scoped types niche use case

How Do I Learn More?

Official docs:

  • Microsoft Learn: What's New in C# 14
  • .NET Blog: Introducing C# 14

Community:

  • GitHub: dotnet/csharplang
  • YouTube: .NET Conf 2025 sessions

Real-World Example

Combining multiple C# 14 features:

// File-scoped helper
file class Parser
{
    // Field-backed property
    public string Input
    {
        get => field;
        set => field = value?.Trim() ?? "";
    }
}

// Extension property
public static class StringExtensions
{
    public static int LineCount(this string str) =>
        str.Split('\n').Length;
}

// Usage with null-conditional assignment
Parser? parser = GetParser();
parser?.Input = LoadData(); // Only assigns if parser isn't null

// Extension property
int lines = parser?.Input.LineCount ?? 0;
Enter fullscreen mode Exit fullscreen mode

Clean, concise, performant.

What's Next?

C# 15 (November 2026) likely brings:

  • Discriminated unions
  • Left join LINQ syntax
  • More pattern matching enhancements

C# continues annual evolution. Predictable, incremental improvements.

Should You Use It in Production?

Absolutely. .NET 10 LTS + C# 14 is production-ready.

Major companies already deployed to .NET 10 within weeks of release. Microsoft runs production workloads on it.

Start new projects on .NET 10. Migrate existing apps during maintenance windows.


Written by Jacob Mellor, CTO at Iron Software. Jacob created IronPDF and leads a team of 50+ engineers building .NET document processing libraries.

Top comments (0)