TWT
TWT

Reputation: 2571

VSIX - Get RootSuffix in Visual STudio extension

To debug Visual Studio extensions you can start an experimental instance with a certain "RootSuffix". See https://learn.microsoft.com/en-us/visualstudio/extensibility/the-experimental-instance?view=vs-2022.

Is there a way to know the provided rootsuffix in the code of your extension?

I.e. "Exp" if the instance was started with "devenv.exe /RootSuffix Exp"

Upvotes: 1

Views: 144

Answers (2)

TWT
TWT

Reputation: 2571

Can be retrieved with following code:

IVsAppCommandLine cmdline = (IVsAppCommandLine)GetService(typeof(SVsAppCommandLine));
cmdline.GetOption("rootSuffix", out var present, out var value)

Upvotes: 1

The DTE object has a CommandLineArguments property which contains the information you need.

Upvotes: 1

Related Questions