OfficeDev / office-js

A repo and NPM package for Office.js, corresponding to a copy of what gets published to the official "evergreen" Office.js CDN, at https://appsforoffice.microsoft.com/lib/1/hosted/office.js.
https://learn.microsoft.com/javascript/api/overview
Other
690 stars 95 forks source link

It is not possible to debug office-js projects with Visual Studio 2019 when Edge is used in the Taskpane #850

Closed Moby-dev closed 4 years ago

Moby-dev commented 5 years ago

Expected Behavior

Using Visual Studio 2019 to edit an Add-in for Excel 365, is should be possible to attach the Taskpane browser to the debugger. This works with IE but not with Edge.

Current Behavior

With Windows 10 ver. >= 1903 / Office 365 ver >= 16.0.11629 , the Office Add-ins use Edge instead of Internet Explorer ( as described here https://docs.microsoft.com/en-us/office/dev/add-ins/concepts/browsers-used-by-office-web-add-ins ).

If the Office Add-ins uses Edge, using Visual Studio 2019 to edit an Add-in for Excel 365, clicking on the "Attach debugger" pop-up link inside the taskpane, nothing happens. Instead if the Office Add-ins uses Internet Explorer, it successfully attaches to Visual Studio.

Steps to Reproduce, or Live Example

You must have Edge as the browser that Office Add-ins use in the Taskpane (Windows 10 ver. >= 1903 / Office 365 ver >= 16.0.11629). Create an Excel 365 Add-in using Yeoman Generator, create a Taskpane , use TypeScript and React. Install necessary node.js libraries with "npm install" and start your app with "npm run". After a short while, Excel starts and the Addin shows up. Open your Add-in Taskpane. Open the above solution from Visual Studio 2019. In the Excel Taskpane, clicking on the "Attach debugger" pop-up link inside the Taskpane, nothing happens (If you have IE, instead, it attaches to VS).

If you try the opposite approach and from Visual Studio 2019 you click Debug -> Attach to process... and choose in the processes list to attach to "WWAHost.exe... (Script,x64)", the debugger starts, and the DOM Explorer in Visual Studio works as expected, but no symbols get loaded for any source file of the Solution, so it is not possible to debug your code.

Context

Your Environment

AbidRahman-MSFT commented 5 years ago

Hello @Moby-dev, thank you for your question.

This is unfortunately a current limitation as mentioned in the documentation. The Attach Debugger tool is only supported for Visual Studio 2015 with Update 3 or later.

For debugging in Windows 10 on Edge or IE, please refer to:

https://docs.microsoft.com/en-us/office/dev/add-ins/testing/debug-add-ins-using-f12-developer-tools-on-windows-10

Thank you

ElizabethSamuel-MSFT commented 4 years ago

@Moby-dev Per comment by @AbidRahman-MSFT, could you try the debugging options and let us know the outcome?

Thanks.

ghost commented 4 years ago

This issue has been automatically marked as stale because it is marked as needing author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. Thank you for your interest in Office Add-ins!

ghost commented 4 years ago

This issue has been closed due to inactivity. Please comment if you still need assistance and we'll re-open the issue.