为什么(简单)办公室加载项拒绝在调试模式下运行?
调试模式(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")
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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的。我让这个运行在我的计算机上,花了一些时间才能弄清楚,但是在这里记录了步骤-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)控件中。您将如何调试代码?
这是我尝试过的,它可以使用 -
从VS IDE启动您的项目,这应该启动Excel窗口。

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

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

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

将您的断点放在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 -
Launch your project from VS IDE, this should launch excel window.

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.

This is the WebView control that loads your HTML UI + associated javascript code.

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

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