Programmatically change Visual Studio Options

2019-09-06 14:39发布

How do I programmatically set and unset Visual Studio Options?

enter image description here

I have done the research and troubleshooting and found it is not possible, ironically now I find myself needing this functionality.

Here is a question I answered specifying why its not possible to programmitically click buttons in the VS Options Dialog: Programmatically reset VisualStudio shortcuts.

I dont need to click a button, I need to change a boolean setting as per screenshot.

Please... if you have any undocumented methods.. please help me. It will improve every developers life, particularly newbies.

2条回答
混吃等死
2楼-- · 2019-09-06 15:18

Just use:

dte.Properties["Debugging", "General"].Item("EnableExceptionAssistant").Value=false;

Most of the options can be retrieved and set this way. See also:

Options Page, Debugging Node Properties

HOWTO: Getting properties from the DTE.Properties collection of Visual Studio .NET.

查看更多
Lonely孤独者°
3楼-- · 2019-09-06 15:30

You'd have to write code to change the following registry key.

HKEY_CURRENT_USER\SOFTWARE\Microsoft\VisualStudio\14.0\ApplicationPrivateSettings\_metadata\revisions\Microsoft\VisualStudio\Platform

TitleCaseMenus is the node you're after :)

You may need to change the Visual Studio version number depending on what you have installed.

Edit: For your new pic the registry key is here: HKCU\SOFTWARE\Microsoft\VisualStudio\14.0\Debugger\UseExcept‌​ionHelper

查看更多
登录 后发表回答