Can't programmatically access a specific options page in Visual Studio

1

I can't seem to access the properties in Visual Studio's options programmatically. Specifically, I have an extension that I need to leverages TFS power tools. I would like to get the value of the folder where the Work Item Templates are stored. Going into the options they are stored at "Microsoft Team Foundation Server 2013 Power Tools -> Work Item Template". Following this example.

NOTE: I am creating a visual studio package extension in VS 2013 for VS 2013.

I have tried retrieving basic options listed in the example and I am able to retrieve its properties. However not the options page's properties I am looking for.

I have tried the following: Category and page - no spaces:

DTE vsEnvironment = (DTE)GetService(typeof(SDTE));
Properties propertiesList = vsEnvironment.get_Properties("MicrosoftTeamFoundationServer2013PowerTools", "WorkItemTemplate");

Category and page - with spaces:

DTE vsEnvironment = (DTE)GetService(typeof(SDTE));
Properties propertiesList = vsEnvironment.get_Properties("Microsoft Team Foundation Server 2013 Power Tools", "Work Item Template");

Each time I receive the following exception: Invalid index. (Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX))

I have also tried using the same naming convention used in the registry(for whatever reason it differs from what the Tools->Options displays). Again, no dice. I have a feeling TFS Power Tools has not enabled the ability for COM objects to leverage it.

So my question; How do I programmatically retrieve an option page's key/value using my Visual Studio extension?

visual-studio-2013
visual-studio-extensions
vsix
vsx
vspackage
asked on Stack Overflow May 19, 2016 by TacoMaster6000

1 Answer

0

I have resolved my own issue. TFS Power tools is not flagged true for the SupportsAutomation argument. If it were then it would be in the regristry under: 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\12.0\AutomationProperties\'

See: https://msdn.microsoft.com/en-us/library/bb166553(v=vs.120).aspx

answered on Stack Overflow May 19, 2016 by TacoMaster6000 • edited May 19, 2016 by TacoMaster6000

User contributions licensed under CC BY-SA 3.0