1

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.

2 Answers 2

2

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.
2
  • Visual Studio 2017 is perfect thanks guy !! i tried 2015 and 2019 but unfortunately not 2017 :'(
    – Alexis
    Jun 3, 2020 at 7:49
  • 2
    Glad I found this thread, but still why was the JS Console removed. Also, the instructions to get the same experience in the dev tools of the browser (which one??) are still unclear to me. I'm kind of mad how little info is available to solve this issue without installing previous versions of VS. MS should have done better. MS seems to have the ability of removing things that worked fine before and have the policy to let you figure out how to solve this.
    – Stephan
    Mar 9, 2021 at 21:45
2

I remember reading that newer Office versions use Edge for the Addin UI.

Thus for Edge you can now use the Microsoft Edge DevTools Preview to have the normal "F12 experience" when running the Addin in a client office.

This works for me with a MS Word on Office 365 x64 when using the "yoman office" scaffolding. I don't have much experience for any other variants.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.