Visual Studio 2017 provides you an easy way to upgrade your project's targeted language version, directly from the editor window. The Light Bulb, which is known as Quick Actions, automatically suggests you to upgrade the language version.

 

In this blog post, we will learn how to invoke it to perform the change for the associated project. Continue reading to learn more.

 

How to upgrade project's language version using quick actions in Visual Studio?

 

In the previous post (How to change the default language version in Visual Studio?) we learned how to change the targeted language version of your application by manually changing the project properties within the Visual Studio IDE. In the next few points, we will learn how this can be easily upgradable, whenever needed, by using the Visual Studio Quick Actions (Light Bulb):

 

Let's assume that you have a C# project, which is targeted to C# 3 as the default language version. Now, you have some requirement that you added some code targeting C# 6.

 

Let's assume you added a static namespace which is introduced with C# 6. You will encounter an error and a light-bulb (Quick Actions) will pop-up with an option to upgrade your project. Here's a screenshot of the same:

 

How to upgrade project's language version using quick actions in Visual Studio?

 

You can select the first option to upgrade the project to 'default' version that the Visual Studio supports. By default, it points to C# latest major version. If you want to upgrade the project to the specific version (in our case, it is C# 6), you can select the second option as demonstrated below:

 

How to upgrade project's language version using quick actions in Visual Studio?

 

Do you know?

My book Mastering Visual Studio 2017 is now available on Amazon and Flipkart at a discounted price. Click here to buy it.

 

Similarly, if your latest code is from any minor upgrade version of C# 7.x, then it will give you option to either upgrade to latest or to the specific minor version, which is C# 7.2 in the below case:

 

How to upgrade project's language version using quick actions in Visual Studio?

 

To know more about the upgrade versioning, read my previous post: How to change the default language version in Visual Studio?. I hope that the post was helpful. Stay tuned to learn more tips on Visual Studio.

 

 

Have a question? Or, a comment? Let's Discuss it below...

Thank you for visiting our website!

We value your engagement and would love to hear your thoughts. Don't forget to leave a comment below to share your feedback, opinions, or questions.

We believe in fostering an interactive and inclusive community, and your comments play a crucial role in creating that environment.