How to check C# version used in Project and install latest version

Updated on: November 09, 2019

Following is the way to check which C# version is installed and getting used in the project:

1. Right click on the Project and select Properties option

2. From the Properties, select Build option => Advanced option

3. Check the Language version selected. You can change the C# version for the project from here. Once you change the C# language version, click on OK button and Save the changes and rebuild the project to check for any language compile error. 

Following are the some of the options available in Language Version for C#:

C# latest supported minor version (default):  

You can set this option even by editing .csproj file and changing the LangVersion property to default value as shown below:

<LangVersion>default</LangVersion>

C# latest supported major version (latestmajor):  If current latest version is 7.3 which is minor version and 7.0 is latest major version, so it will select 7.0 as latestmajor version.

You can set this option even by editing .csproj file and changing the LangVersion property to latestmajor value as shown below:

<LangVersion>latestmajor</LangVersion>

C# latest supported minor version (latest): If current latest version is 7.3, then it will select 7.3 as a latest minor version.

You can set this option even by editing .csproj file and changing the LangVersion property to latest value as shown below:

<LangVersion>latest</LangVersion>



How to Install Latest C# version for the project:

1. From the above options, you can check for which C# version is installed on this machine. If you don't have latest C# version, then you can install it by installing new version of Visual Studio and new version of .NET framework on your machine or just update your existing Visual Studio:

To Install new version of VS, visit: https://visualstudio.microsoft.com/vs/ 

To Update existing VS, click on: Help=> Check for Updates => click on Update button

Related Articles