Version: 2021.1
Referencing additional class library assemblies
Scripting backends

C# compiler

To compile C# source code in a Unity Project, the Unity Editor uses a C# compiler.

Scripting Runtime Version C# compiler C# language version
.NET 4.6 equivalent Roslyn C# 8.0

The Editor passes a default set of options to the C# compiler. To pass additional options in your project, see the documentation for Platform Dependent Compilation.

Note that the C# 8 feature “Default interface methods” is not currently supported. The C# compiler will emit an error message if this feature is used.


  • Roslyn compiler exposed in 2018.3 NewIn20183
  • C# version increased to 8.0 in 2020.2 2020.2 NewIn20202

C# compiler Roslyn compiler NewIn20183

Referencing additional class library assemblies
Scripting backends