Igavshne
Igavshne

Reputation: 697

How to call built-in VS command?

How do I call Visual Studio's "Build Solution" command from a custom button in an extension? I don't expect code as an answer to this (but that would be cool), -a link to a resource that explains it would be helpful enough.

Upvotes: 0

Views: 101

Answers (1)

stuartd
stuartd

Reputation: 73253

The extensions model changes too fast to keep up, but this is how I used to execute a command in one:

DTE2 dte = (DTE2)GetService(typeof(DTE));
dte.ExecuteCommand("VS.CommandName", [parameters (if any)…]);

Upvotes: 2

Related Questions