调试 Outlook 加载项桌面

Lum*_*ein 6 outlook-addin office-js outlook-web-addins

我目前正在使用 yeoman 和 generator-office for Outlook 开发插件,以将电子邮件及其附件保存到另一个服务。

Outlook 版本:MS Office Professional Plus 2016 v.16.0.48.49.1000

我可以通过转到 File->Manage Add-ins->(Outlook webapp extensions page opens)->Add from file->Select my manifest.xml 来旁加载加载项。

然后我跑npm run start,我得到:

App type: desktop
Enabled debugging for add-in 17717569-bd61-4c6a-b99d-ca55924a2916. Debug method: 0
Starting the dev server... (webpack-dev-server --mode development)
The dev server is running on port 3000. Process id: 9660
Sideloading the Office Add-in...
Error: Unable to start debugging.
Error: Unable to sideload the Office Add-in.
Error: Sideload is not supported.
Run Code Online (Sandbox Code Playgroud)

加载项是旁加载的,我可以使用它,但无法附加调试器,我被阻止了。

任何已知的解决方案?

编辑:我按照https://docs.microsoft.com/en-us/outlook/add-ins/quick-start 中的指南进行操作。

@MS 团队如果无法使用 Yeoman 添加调试器,是否可以使用 Visual Studio 方法?

小智 6

您可以运行开发服务器 ( npm run dev-server) 而不是使用,npm start因为 Outlook 不支持旁加载。开发服务器运行后,您可以使用您提到的步骤加载加载项。加载项在 Outlook 中运行后,您可以使用浏览器开发工具对其进行调试。

如果您使用的是 Windows 10 版本 1903 或更高版本,则它应该使用 Edge WebView,并且您可以使用 Windows 10 商店中的 Edge DevTools Preview 对其进行调试。对于使用 Internet Explorer WebView 的先前版本的 Windows,使用F12开发工具进行调试。