Search code examples
ms-officeoffice-jsoffice-addins

Office Add-in how to see console.log


I used Visual Studio to create an office project,

I try to see were is written the console.log text.

Looking around stackoverflow and internet I tried to attach debugger to my project or any other things related in so many posts, but nothing works.

In the code provided by the Office Add in template, there is a banner to show the error directly in the taskpane. But there is also a console.log to show in the console ? Well... I can't see where this texte is written.

In the image below, on "1" they catch the error, on "2" they show the error on the banner in html, and in "3" they show the console.log error ...

enter image description here

As you can see, my taskpane well display the error banner, so logically, the console.log is displayed somewhere.

enter image description here

Below images of the different consoles and terminals that can be the most logical to show error, but still nothing

enter image description here enter image description here

In all the other tabs there is nothing, and I tried ctrl+Q to activate Javascript console or whatever that could be useful for debugging.


Solution

  • The JavaScript console was removed from Visual Studio 2019. You have basically 2 options:

    1. Install Visual Studio 2017 side-by-side Visual 2019 (or install Visual 2017 on another computer) and use VS 2017 to develop Office Add-ins.
    2. Use the Dev Tools of the browser that the add-in is using to run. For which browser your add-in is using, see Browsers used by Office Web Add-ins.