Saturday 8 October 2022

Check The C# Language Version of a Project

 C# Language version used in your project is determined by the .NET Framework you are using. We can set specific language version for a project if required for exxampe if we need to use the preview features we can add in the <LangVersion>preview</LangVersion> .csproj file <PropertyGroup>. If the language version is not specifically set and if you want to check the language versio used by your project, the following explained step can be performed.

Add the below line to any of the .cs file in your project.

#error version

Then compile your project and you will see an error message with the language version used in your project as shown below.





No comments:

Popular Posts