mimic
mimic

Reputation: 5224

How to detect the language version of Visualstudio?

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

Answers (2)

Sharunas Bielskis
Sharunas Bielskis

Reputation: 1203

Here is the example of how to detect default C# language version in Visual Studio 2019:

  1. With a mouse, select the required project and right click then in opened window select Properties.

  2. In opened Properties Window Select vertical Build tab and click on Advanced button.Build Window

  3. In the opened Advanced Build Settings window it is the row - Language version. In the example: Automatically selected based on framework version.

Advanced window

  1. 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.

  2. Which framework version the project uses are in the project settings file. In the example image Project settings framework version is .NET Core 3.0 version, so the default C# language version is 8.00.

Upvotes: 0

Hans Passant
Hans Passant

Reputation: 942000

I think you want to use DTE.LocaleID, that's what other add-ins use to find their resource DLLs.

Upvotes: 1

Related Questions