0

I am trying to automatically invoke a menu item in Visual Studio by writing an addin. How can I find the name of that event?

For example a compile command can be executed by using

DTE.ExecuteCommand("Build.Compile")

But I have a menu item that I have installed as a separate VSPackage and I'd like to execute that and I unfortunately do not know how to find the name of the command.

Mark
  • 10,754
  • 20
  • 60
  • 81

2 Answers2

3

You can set registry dword value HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0\General\EnableVSIPLogging=1 (12.0 is for VS 2013). Then pressing CTRL+SHIFT and hovering over or selecting a menu command will show you its name and id.

Sergey Vlasov
  • 26,641
  • 3
  • 64
  • 66
1

The name of a command that you created in a package is in the .vsct file. Also, you can locate command names in Tools, Customize window, Keyboard button, "Show commands containing"

Carlos Quintero
  • 4,300
  • 1
  • 11
  • 18