'Debugging desktop Outlook Add-in
I'm trying to debug Outlook addin in the desktop mode.
- node v14.18.3 32-bit
- Microsoft® Outlook® 2019 MSO (Version 2110 Build 16.0.14527.20234) 32-bit
- Windows 10
launch.json:
{
"name": "Outlook Desktop (Edge Legacy)",
"type": "office-addin",
"request": "attach",
"url": "https://localhost:3000/taskpane.html?_host_Info=Outlook$Win32$16.01$en-US$$$$0",
"port": 9222,
"timeout": 600000,
"webRoot": "${workspaceRoot}",
"preLaunchTask": "Debug: Outlook Desktop",
"postDebugTask": "Stop Debug",
}
I'm getting the following error: [vscode-debugger-extention-for-office-addins] Error processing "attach": connect ECONNREFUSED 127.0.0.1:9222
In my addin I got the info about a webview user agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; WebView/3.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36 Edge/18.19044
So I used npx office-addin-dev-settings webview .\manifest.xml edge-legacy to set up the correct webview. The error is still there. I would appreciate any suggestions on how to solve this problem.
Solution 1:[1]
The browser used by Office Add-ins depends on both your computer's OS and the version of Office you are using, as documented here. You are using Windows 10 and Outlook 2019, so you should be using IE as your browser. The Microsoft Office Add-in Debugger Extension for Visual Studio Code allows you to debug your Office Add-in against the Microsoft Edge with the original webView (EdgeHTML) runtime. For instructions about debugging against Internet Explorer, see this article.
Solution 2:[2]
Most probably you still got Internet Explorer used by Outlook for running web add-ins. There are several factors that could cause this on your side. You could have:
- Non-subscription versions of Office for Windows. These will continue to use Internet Explorer 11 as the web viewer.
- Office running on versions of Windows 10 lower than 1903. These will also continue to use Internet Explorer 11.
- Versions of Office lower than 16.0.11629. These will also continue to use Internet Explorer 11.
It is also not clear what Windows build number you have got installed on the system. So, I'd recommend installing the latest updates for the OS and Outlook. Also you need to make sure you are using Office 365 version of Outlook.
Beginning with Office 365 version 16.0.11629 and Windows 10 version 1903, Office Add-ins running on Office 365 for Windows will use a Microsoft Edge WebView as the runtime.
As soon as you can install the required software you will be eligible to use the Microsoft Edge DevTools extension in VSCode.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Outlook Add-ins Team - MSFT |
| Solution 2 | Eugene Astafiev |
