Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where does Visual Studio store toolbar and menu customizations?

Is there a file somewhere that I can use to do massive changes to the context menu in an easier fashion?

The GUI:

enter image description here

gives me no way to move a command from one menu to another, nor does it let me see what the command actually is (in order to add that same exact command to another menu), thus I don't have much to work with.

And thus I am seeking a file (or a gigantic registry key? ugh.) that I can edit somewhere else where I have more powerful tools. (my VS version is Enterprise 2017 if that matters)

like image 441
NH. Avatar asked Oct 16 '22 21:10

NH.


1 Answers

You can find the defaults at C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Profiles, with a general settings and some language-specific overrides. There's an additional override in IDE\VC\Profiles as well.

In my case, I wanted to move 'Start new instance" on a Project into the top-level context menu. So I:

  1. Made a copy of CurrentSettings.vssettings
  2. Added a new command where I wanted it (via the Tools > Customize... GUI)
  3. Found the command I wanted to clone and moved it up one
  4. Closed VS (it saves on exit)
  5. Compared the two files to find the diffs (use your favorite tool.) You'll find them under Category[@name="Environment_CommandBars"]\CommandBars\UserCustomizations as add remove and modify entries
  6. Took the Cmd attribute from the moved entry and pasted it over the added one (it was Cmd="{1496A755-94DE-11D0-8C3F-00C04FC2AAE2}:00000164" for me, to save interested parties a few steps)
  7. Undid the move to retain only the added entry

I wasn't able to find a command entry for this anywhere in the defaults, so had to figure it out the hard way.

like image 67
John Neuhaus Avatar answered Dec 02 '22 11:12

John Neuhaus