kunal-chowdhury.com

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


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.

 

 



If you have come this far, it means that you liked what you are reading. Why not reach little more and connect with me directly on Twitter, Facebook, Google+ and LinkedIn. I would love to hear your thoughts and opinions on my articles directly.

Don't forget to share your feedback/queries in the comment section below.



0comments


© 2008-2018 Kunal-Chowdhury.com | Designed by Kunal Chowdhury
Back to top