简体   繁体   English

Visual Studio Shell 14 升级破坏了 VSPackage 中的命令捕获

[英]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.

相关问题 动态显示工具栏上的自定义Visual Studio VSPackage命令 - Dynamic display custom Visual Studio VSPackage command on toolbar 安装后Visual Studio VSPackage行为不同 - Visual studio VSPackage behavior different after installation 从VSPackage获取Visual Studio配色方案 - Get the Visual Studio color scheme from a VSPackage 如何在VSPackage插件中捕获Visual Studio命令? - How to capture Visual Studio commands in a VSPackage Plugin? 如何更改Visual Studio集成包(VSPackage)上的图标? - How do I change icon on a Visual Studio Integration Package (VSPackage)? 如何使用VSPackage检测Visual Studio IDE是否正在关闭? - How to Detect if Visual Studio IDE is closing using VSPackage? 如何从VSPackage获取当前运行的Visual Studio安装路径 - How get the current running Visual Studio installation path from VSPackage 如何在VSPackage中动态添加命令(Visual Studio 2013程序包) - How to add commands dynamically in VSPackage (Visual Studio 2013 Package) Visual Studio VSPackage /单个文件生成器-将消息记录到错误列表 - Visual Studio VSPackage / Single File Generator - Log Message to Error List VisualStudio VSPackage自定义命令 - VisualStudio VSPackage Custom Command
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM