[英]Visual Studio Shell 14 upgrade ruins command capturing in VSPackage
I have a Visual Studio Shell 2013 application and I would like to upgrade to Shell 2015 and I faced with a problem related to command capturing.我有一个 Visual Studio Shell 2013 应用程序,我想升级到 Shell 2015,但我遇到了与命令捕获相关的问题。 In the old version the F1 command is captured and overwrite the default behaviour.
在旧版本中, F1命令被捕获并覆盖默认行为。 (based on How to capture Visual Studio commands in a VSPackage Plugin? )
(基于如何在 VSPackage 插件中捕获 Visual Studio 命令? )
This is the code from VSPackage that is working with the shell 13:这是来自与 shell 13 一起使用的 VSPackage 的代码:
m_objDTE = (DTE)GetService(typeof(DTE));
var F1HelpGuid = typeof(VSConstants.VSStd97CmdID).GUID.ToString("B");
var F1HelpID = (int)VSConstants.VSStd97CmdID.F1Help;
F1HelpEvent = m_objDTE.Events.CommandEvents[F1HelpGuid, F1HelpID];
F1HelpEvent.BeforeExecute += CapturedF1HelpCommand;
After the update the F1 command is not captured.更新后未捕获F1命令。
Do You have any idea why can it happened?你知道为什么会发生吗? Does the F1 help Id changed?
F1帮助 Id 改变了吗?
Did you happen to see my latest response to your post in the VS Extensibility forum ?您是否碰巧在VS Extensibility 论坛中看到了我对您帖子的最新回复?
The reason the event never fires is because the Help commands are disabled via the stub applications' ApplicationCommands.vsct.事件从未触发的原因是因为通过存根应用程序的 ApplicationCommands.vsct 禁用了帮助命令。 You need to comment out the
你需要注释掉
entry to reenable the F1 command.重新启用 F1 命令。 Then, you should see your event handler being invoked.
然后,您应该会看到您的事件处理程序被调用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.