Skip to content

Features by tag

Browse every C# feature grouped by what it is for, such as readability, performance or correctness.

Every feature is tagged with what it is for rather than which version it arrived in. Use this when you know the kind of problem you have - "this allocation is in a hot loop" - rather than the release you need to target.

All 158 feature pages are tagged, and most carry more than one tag, so a feature can appear under several headings.

Jump to a tag ​

Code reduction ​

Features that remove boilerplate you had to write before.

Readability ​

Features that make the intent of existing code clearer.

Correctness ​

Features that let the compiler catch a mistake you could previously make.

Performance ​

Features that avoid an allocation, a copy or a virtual call.

New scenarios ​

Features that make something possible that was not possible before.

Type safety ​

Features that narrow what a type is allowed to hold.

Code generation ​

Features aimed at generators and tooling rather than hand-written code.

  • Partial types C# 2.0 - Split type definitions between files to separate generated and human-written code.
  • Partial methods C# 3.0 - Define a method signature in a partial class for implementation elsewhere.
  • Extending partial methods C# 9.0 - Partial methods can have return values and out parameters.
  • File local types C# 11.0 - Restrict a type so it can only be referenced from the file it is declared in.
  • Interceptors C# 12.0 - Allow a method to declare it replaces another method.
  • Partial properties & indexers C# 13.0 - Allow properties and indexers to be partially defined like partial methods.
  • Partial events and constructors C# 14.0 - Allow constructors and events to be partially defined like partial methods and properties.

Interop ​

Features for working with other languages, runtimes and platforms.

  • Extern alias C# 2.0 - Disambiguate types with the same fully-qualified name from different assemblies.
  • Dynamic binding C# 4.0 - Defer type checking until runtime using the dynamic keyword.
  • Embedded interop types C# 4.0 - Embed COM interop type information directly into assemblies.
  • Unmanaged constructed types C# 8.0 - Allow a generic type built from unmanaged type arguments to satisfy the unmanaged constraint.
  • Function pointers C# 9.0 - Call methods through pointers without delegate allocations in performance-critical code.
  • Memory safety C# 15.0 - Pointer relaxations, requires-unsafe members and unsafe expressions tie unsafe to the operations that access memory.

Discovery ​

Features that surface information from the compiler.

Extensibility ​

Features for adding behaviour to types you do not own.

Concurrency ​

Features that change how code runs in parallel.

  • New lock object C# 13.0 - A new disposable System.Threading.Lock type optimized for modern lock statements.

Last updated:

Powered by Intracia