问题
I'm currently developing an Add-in using yeoman and generator-office for Outlook to save an email and its attachments to another service.
Outlook Version: MS Office Professional Plus 2016 v.16.0.48.49.1000
I am able to sideload the add-in by going to File->Manage Add-ins->(Outlook webapp extensions page opens)->Add from file->Select my manifest.xml.
Then I run npm run start
and I get:
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.
The add-in is sideloaded and I'm able to use it, but without being able to attach a debugger I'm blocked.
Any known solutions for this?
Edit: I followed the guide from https://docs.microsoft.com/en-us/outlook/add-ins/quick-start.
@MS Team If it is not possible to add a debugger using Yeoman, is it possible using the Visual Studio approach ?
回答1:
You can run the dev server (npm run dev-server) rather than use "npm start" because Outlook does not support sideloading. Once the dev server is running, you can load the add-in using the steps you mentioned. Once the add-in is running in Outlook, you can use the browser dev tools to debug it. If you are on Windows 10 Version 1903 or later, it should be using the Edge WebView, and you can use the Edge DevTools Preview from the Windows 10 Store to debug it. For previous version of Windows, where the Internet Explorer WebView is being used, the F12 dev tools are used to debug.
来源:https://stackoverflow.com/questions/58501403/debugging-outlook-add-in-desktop