C# 10-12 Features in C#

From the C# Programming Language cheat sheet · Latest C# Features · verified Jul 2026

C# 10-12 Features

Latest language enhancements and syntax improvements

csharp
// Global using (C# 10)
global using System;
global using System.Collections.Generic;

// File-scoped namespace (C# 10)
namespace MyApp.Services;

// Raw string literals (C# 11)
string json = """
{
    "name": "John",
    "age": 30
}
""";

// Required members (C# 11)
public class Person
{
    public required string Name { get; init; }
}

// Collection expressions (C# 12)
int[] numbers = [1, 2, 3, 4, 5];
💡 Global using reduces repetitive using statements
⚡ Raw string literals handle multi-line strings elegantly
📌 Required members ensure proper object initialization
🟢 Collection expressions provide concise initialization
Back to the full C# Programming Language cheat sheet