...
/Managing C# Compiler Versions and .NET SDK Compatibility
Managing C# Compiler Versions and .NET SDK Compatibility
Learn about .Net SDK versions and C# language compiler configurations.
The .NET language compiler for C# and Visual Basic, also known as Roslyn, and a separate F# compiler is distributed as part of the .NET SDK. To use a specific version of C#, we must have at least that version of the .NET SDK installed, as shown in the following table:
.NET SDK | Roslyn Compiler | Default C# Language |
1.0.4 | 2.0-2.2 | 7.0 |
1.1.4 | 2.3-2.4 | 7.1 |
2.1.2 | 2.6-2.7 | 7.2 |
2.1.200 | 2.8-2.10 | 7.3 |
3.0 | 3.0-3.4 | 8.0 |
5.0 | 3.8 | 9.0 |
6.0 | 4.0 | 10.0 |
7.0 | 4.4 | 11.0 |
Class libraries and .NET standards
When we create class libraries, we can choose to target .NET standard as well as versions of modern .NET. They have default C# language versions, as shown in the following table:
.NET Standards | C# |
2.0 | 7.3 |
2.1 | 8.0 |
Note: Although we must have a minimum version of the .NET SDK installed to access a specific compiler version, the projects we create can target older versions of .NET and still ...