10

When I create a new project in Visual studio 2015 (a csharp console project for example) the language level of the new project is set to c#5.0 while I actually want c#6.0, I know it doesn't take much time to change this but it's quite annoying, how would you change that to default to c#6.0 can't seem to find it in the settings.

1 Answers1

2

Open project options, go to Build > Advanced

project properties

for Language Version select C# 6.0.

advanced dialog

By the way, it's strange that your default language version for VS 2015 is 5.0.

  • well I have visual studio 2015 and it creates the projects with a default language level of c# 5.0 that is the problem I have actually –  Oct 25 '15 at 13:14
  • So, if you try to use any C# 6 constructions, the code does not compile? – Vladimir Svyatski Oct 25 '15 at 13:16
  • Well no for example I create a new console project, and use a null propagation or expression body the code does not compile, I need to change the language level to c# 6.0 for it to compile –  Oct 25 '15 at 13:17
  • Yea I have no idea why –  Oct 25 '15 at 13:37
  • @HyunMi Check my updated answer, I hope it solves your problem. – Vladimir Svyatski Oct 25 '15 at 13:39
  • 19
    This is useful, but it is not changing the default exactly; it is making a particular project not use the default. Is there a way to change the default instead of changing each of my projects? – Mishelle Jul 11 '16 at 16:47
  • https://stackoverflow.com/questions/44699125/how-to-change-visual-studio-2017-default-language-version-for-all-projects here is the answer where the "default" come from and what it means. In short: default is the default of the current compiler and you can change it. – uli78 Sep 24 '18 at 05:30