Mark
Mark

Reputation: 10964

How to find the name of a menu event in Visual Studio

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.

Upvotes: 0

Views: 463

Answers (2)

Carlos Quintero
Carlos Quintero

Reputation: 4414

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"

Upvotes: 1

Sergey Vlasov
Sergey Vlasov

Reputation: 27890

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.

Upvotes: 3

Related Questions