Lets Learn below how to “Use Quick Actions in Visual Studio to upgrade project’s language version”. In Visual Studio, you saw the lightbulb. If an error occurs, Visual Studio provides suggestions on how to resolve the issue. We all know this feature of Visual Studio. Did you know: You can also use this feature to update your project’s language version. In the previous article Choose the Latest C# Language Version (Minor Version) in Visual Studio 2017, we learned how to update the latest major or minor version of the language. This article explains how you can update directly using the Quick Actions feature.
Upgrade project’s language version using Quick Action
Consider your project is targeting to C# 7.0 version (set a default as major version) and you are trying to C# 7.2 (minor version of the release) language feature.
More related post which you may like:
Now, in this case, you might see a warning message stating that we are trying to use a language feature that is not available in C# 7.0. If you need this feature, we need to continue upgrading the language version. In this case, we tend to change the project’s language version manually.
However, a little press of Ctrl+. (Quick Actions), will brings up the fix and where it will ask you to upgrade the project.
You can check more article on our website under C# section HERE or you can also check same on Microsoft Docs too.