Programmatically change Visual Studio Options

a 夏天 提交于 2019-12-12 03:31:14

问题


How do I programmatically set and unset Visual Studio Options?

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.


回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/40525815/programmatically-change-visual-studio-options

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!