为什么(简单)办公室加载项拒绝在调试模式下运行?

发布于 2025-02-13 07:52:46 字数 752 浏览 0 评论 0原文

我正在关注 https://learn.microsoft.com/en-us/office/dev/dev/add-ins/quickstarts/excel-quel-quickstart-jquery?tabs=visalStudio

调试模式(F5),加载项不加载(错误” 加载项无法启动。关闭此对话框以忽略问题或单击“重新启动”以重试”)

当我从VS2022中运行加载项而无需调试(Ctrl-f5)时加载项正常工作...

在这两种情况下,https:// localhost上的页面:xxxx/home.html工作正常,只有Excel拒绝使用插件,同时使用VS调试时模式。

我还有另一台计算机两种方式正常。两台计算机都有类似的软件设置。

我应该从哪里开始寻找原因?

谢谢

I am following the tutorial on https://learn.microsoft.com/en-us/office/dev/add-ins/quickstarts/excel-quickstart-jquery?tabs=visualstudio

When I run the add-in from VS2022 in debug mode (F5), the add-in does not load (error "This
add-in could not be started. Close this dialog to ignore the problem or click "Restart" to try again")
enter image description here

When I run the add-in from VS2022 without debugging (CTRL-F5), the add-in works fine...

In both cases, the page on https://localhost:xxxx/Home.html is working fine, it's only Excel that refuses to load the plugin while using VS Debug Mode.

I have another computer on which it both ways are working fine. Both computers have a similar software setup.

Where should I start looking for the cause of this?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

明明#如月 2025-02-20 07:52:46

好的。我让这个运行在我的计算机上,花了一些时间才能弄清楚,但是在这里记录了步骤-e href =“ https://learn.microsoft.com/en-us/office/office/dev/dev/add-ins-in /开发/debug-office-add-ind-in-in-Visual-studio“ rel =” nofollow noreferrer“> https://learn.microsoft.com/en-us/office/dev/add-ins/develop/debug ouck-office-add-asdd-ins-ind-ins-in-visual-studio

这是一个提示 - 您在JavaScript中编写插件代码,它将在Excel IDE中加载到旧版WebView(EdgeHTML)控件中。您将如何调试代码?

这是我尝试过的,它可以使用 -

  1. 从VS IDE启动您的项目,这应该启动Excel窗口。

  2. 单击'Home' - '显示任务Pane'按钮。如果不可见,则任务窗口窗口应显示在右侧。这是加载添加的地方。

  3. 这是加载您的HTML UI +关联JavaScript的WebView控件 代码。

  4. 右键单击它,单击'Inspect'菜单。这应该启动您在调试网页时通常会获得的开发人员工具。

  5. 将您的断点放在JS代码中并点击按钮。调试器应在关联的JS代码中打破。

OK. I got this to run on my machine, it took a bit of time to figure out but steps are documented here - https://learn.microsoft.com/en-us/office/dev/add-ins/develop/debug-office-add-ins-in-visual-studio

Here is a hint - You write the plugin code in JavaScript, it gets loaded in legacy WebView (EdgeHTML) control in Excel IDE. How would you debug the code?

Here is what I tried and it worked -

  1. Launch your project from VS IDE, this should launch excel window.
    enter image description here

  2. Click on 'Home'-'Show Taskpane' button. If it is not visible, the Taskpane window should appear on the right side. This is where add in is loaded.
    enter image description here

  3. This is the WebView control that loads your HTML UI + associated javascript code.
    enter image description here

  4. Right click on it, click on the 'Inspect' menu. This should launch the Developer Tools that you normally get when debugging web pages.
    enter image description here

  5. Put your break points in the JS code and hit the button. The debugger should break in associated JS code.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文