Select C# version in Visual Studio

Want to try out features of newest of some specific version of C# but Visual Studio 2017 can’t compile it? Well, by default major versions of C# are supported and if some other version is needed it must be turned on from project settings. This blog post shows how to switch between C# versions in Visual Studio 2017.

To make Visual Studio 2017 to use some other version of C# follow the steps shown on the following image.

Visual Studio 2017: Switch C# version

For those who need some more help the steps are described here:

  1. Right click on the project name and select Properties from context menu
  2. Select Build tab from left
  3. Scroll down and click Advanced button to open advanced build settings
  4. From Language version dropdown select C# version you are interested in

C# latest minor version (latest) is the option to select if you want latest version of C#.

NB! If you are writing some program that is later deployed to some other box be careful when playing with these settings as target environment may use older version of C#. Make it sure first what version of C# is available on target environment and then make your selection.

Same steps work also for Visual Studio 2015 but C# 6.0 is currently the latest version of C# available there.

Gunnar Peipman

Gunnar Peipman is ASP.NET, Azure and SharePoint fan, Estonian Microsoft user group leader, blogger, conference speaker, teacher, and tech maniac. Since 2008 he is Microsoft MVP specialized on ASP.NET.

    2 thoughts on “Select C# version in Visual Studio

    Leave a Reply

    Your email address will not be published. Required fields are marked *