Which version of C# am I using in Visual Studio 2019

Learn how to find the version of C# language your Visual Studio is using and how to change it.

If you’re using the latest version of Visual Studio 2019, C#, you may not see the option to change the C# language version of your project. This is a new change in Visual Studio 2019/.NET Core 3.0. The new C# compiler chooses the default version based on your .NET target framework selected for your project in Visual Studio.
The compiler determines a default language based on the following rules:
Target framework version C# language version default
.NET Core             3.x   C# 8.0
.NET Core             2.x   C# 7.3
.NET Framework   all   C# 7.3
Note: If you’re using a previous version of Visual Studio, you’ve an option to select a language version up to C# 7.3.
C# 8.0 is the latest version of C# language. C# 8.0 introduces several new features. To learn more about these features, visit https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-8
Can I change the default C# version?
Yes, you may.
If you open your .csproj project file in Notepad or any text editor, you can add a new property group and set the LangVersion value to specify the language version your project will use. The default proj file looks like the following in XML.
  1. <Project Sdk="Microsoft.NET.Sdk">  
  2. <PropertyGroup>  
  3. <OutputType>Exe</OutputType>  
  4. <TargetFramework>netcoreapp3.0</TargetFramework>  
  5. </PropertyGroup>  
  6. </Project>  
  7. The  
  8. <Project Sdk="Microsoft.NET.Sdk">  
  9. <PropertyGroup>  
  10. <OutputType>Exe</OutputType>  
  11. <TargetFramework>netcoreapp3.0</TargetFramework>  
  12. </PropertyGroup>  
  13. <PropertyGroup>  
  14. <LangVersion>8.0</LangVersion>  
  15. </PropertyGroup>  
  16. </Project>  
The LangVersion value can be one of the following: 
  • preview
  • latest
  • latestMajor
  • 8.0
  • 7.3
  • 7.2
  • 7.1
  • 7, 6, 5, 4, and 3