Reputation: 5224
I need to detect the language version of VS and do some action depending on it. How to detect it? Thanks
Upvotes: 3
Views: 2475
Reputation: 1203
Here is the example of how to detect default C# language version in Visual Studio 2019:
With a mouse, select the required project and right click then in opened window select Properties.
In opened Properties Window Select vertical Build tab and click on Advanced button.
In the opened Advanced Build Settings window it is the row - Language version. In the example: Automatically selected based on framework version.
If the information which framework version corresponds default C# language version, is required the link (Why can't I select a different C# version? - C# language versioning) can be opened. In this page are the rules on how according to the target framework is determined default C# language version and information on how the default C# language version can be changed.
Which framework version the project uses are in the project settings file. In the example image framework version is .NET Core 3.0 version, so the default C# language version is 8.00.
Upvotes: 0
Reputation: 942000
I think you want to use DTE.LocaleID, that's what other add-ins use to find their resource DLLs.
Upvotes: 1