Sometimes we need to change the C# language version. It is required in many cases suppose you have done some code in C# 6 but client is asking to provide the code in C# 5 or C# 4. But you do not exactly remember how many features you have used which is only available in C# 6 but not in any other lower version.
I have written some articles on C# 6 features and in that case I need to know that what was actual status for this feature in lower version. For that I need to change the language version many times from C# 6 to C# 5 or C# 4. This is a very common practice, many of us may know it, but it will be helpful for those people who are not aware about it. Let’s have a look on how to change the language version.
To change the language do the following things:
Step 1: Select the project from the solution explorer window for which you want to change the language version and right click on it.
Step 2: Click on properties or Press “Alt + Enter”. It will open a new window.

Step 3: Click on Build tab as in the following image.
Step 4: Click on Advanced Button.

Step 5: Go to Language Version dropdown list and select the language version whatever you want.


Let’s say change it to C# 5.
Step 6: Click on OK button after changing the language in dropdown.

Now click on save button to save it.

That’s it. Now the language has been changed and if there is any written code which is not supported in C# 5. It will give error during project build.
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment
It is the same account you read, post and publish with — and you will come straight back to this page.

Banketeshvar NarayanPosted May 1, 2016, 1:54 AM
Thanks to all the readers. Now time has come to learn new version C# 7 for start up you can go through my article http://www.c-sharpcorner.com/article/visual-studio-15-preview-first-look-C-Sharp-7/
Danny SchneiderPosted Apr 29, 2016, 3:43 AM
Thanks for that short hint, but what is the real use case? I thought the most common new features are not framework dependent and so only the compiler must handle most of these language snippets. And when you are working in VS2015 there should be no problem? What do you think?
Banketeshvar NarayanPosted Nov 30, 2015, 11:34 AM
Thanks Suman Verma
Suman VermaPosted Nov 30, 2015, 5:49 AM
nice one
Suman VermaPosted Nov 30, 2015, 5:49 AM
nice one
Banketeshvar NarayanPosted Nov 30, 2015, 5:41 AM
Thanks Yaduveer Saini
Yaduveer SainiPosted Nov 30, 2015, 4:19 AM
Nice Article Banketeshvar Narayan
Banketeshvar NarayanPosted Nov 30, 2015, 2:27 AM
Thanks Aishwarya
Aishwarya DPosted Nov 30, 2015, 1:47 AM
Nice
Banketeshvar NarayanPosted Nov 29, 2015, 11:50 PM
Thanks Santhakumar Munuswamy
Santhakumar MunuswamyPosted Nov 29, 2015, 11:45 PM
Good one
Banketeshvar NarayanPosted Nov 29, 2015, 10:54 PM
Thanks Raja T
Raja TPosted Nov 29, 2015, 10:50 PM
Nice , Thanks for sharing