从 2 台计算机处理同一个 Visual Studio 项目
我有一个 VSTO 项目,带有用于 Excel 和一些表单的自定义功能区,我遇到以下问题:我尝试在 PC 和移动笔记本电脑上处理同一个项目(在 PC 上启动)。
我将项目文件夹与 Dropbox 同步,并在笔记本电脑上安装了证书。 在PC上,没有问题。在笔记本电脑上,我没有收到任何错误,但当我运行它时,它不显示自定义功能区。 谁能帮我弄清楚我做错了什么?
I have a VSTO project, with a custom ribbon for Excel and some forms, and I have the following problem: I'm trying to work on the same project on both a PC and on a laptop for mobility (started on PC).
I synchronized the project folder with Dropbox, I installed the certificate on my laptop.
On the PC, no problems. On the laptop, I don't get any errors but when I run it, it does not display the custom ribbon.
Can anyone help me figure out what I'm doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先,您需要确保主机应用程序加载了加载项。尝试设置断点并从VS开始调试。如果遇到任何断点,那么您需要开始处理功能区错误。如果没有,您需要检查主机应用程序未加载该加载项的原因。加载项无法加载的原因有多种,请参阅 如何对未加载的 VSTO 插件进行故障排除? 了解更多信息。
默认情况下,如果 VSTO 外接程序尝试操作 Microsoft Office 用户界面 (UI) 但失败,则不会显示错误消息。但是,您可以将 Microsoft Office 应用程序配置为显示与 UI 相关的错误消息。您可以使用这些消息来帮助确定为什么不显示自定义功能区,或者为什么显示功能区但不显示控件。
要显示 VSTO 外接程序用户界面错误,您需要:
文件
选项卡。选项
。高级
。显示 VSTO 外接程序用户界面错误
,然后单击确定
。请参阅 如何:显示加载项用户界面错误了解更多信息。
First of all, you need to make sure the add-in is loaded by the host application. Try to set a breakpoint and start debugging from VS. If any breakpoint is hit then you need to start working on the ribbon errors. If not, you need to check why the add-in is not loaded by the host application. There are multiple reasons why the add-in may not be loaded, see How to troubleshoot a VSTO addin that does not load? for more information.
By default, if a VSTO add-in attempts to manipulate the Microsoft Office user interface (UI) and fails, no error message is displayed. However, you can configure Microsoft Office applications to display messages for errors that relate to the UI. You can use these messages to help determine why a custom ribbon does not appear, or why a ribbon appears but no controls appear.
To show VSTO Add-in user interface errors you need:
File
tab.Options
.Advanced
.Show VSTO Add-in user interface errors
, and then clickOK
.See How to: Show Add-in user interface errors for more information.