答案 0 :(得分:0)
我收到了代码。这样做了
var type = typeof(VSConstants.VSStd97CmdID);
var commandId = new CommandID(type.GUID, (int)VSConstants.VSStd97CmdID.AddClass);
var oleMenuCommandService = GetService(typeof(IMenuCommandService)) as OleMenuCommandService;
oleMenuCommandService.GlobalInvoke(commandId);
参考: - 链接here