Office Add-in how to see console.log - ms-office

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 ...
As you can see, my taskpane well display the error banner, so logically, the console.log is displayed somewhere.
Below images of the different consoles and terminals that can be the most logical to show error, but still nothing
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.

The JavaScript console was removed from Visual Studio 2019. You have basically 2 options:
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.
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.

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.

Related

No DOM Explorer or JS Console in Visual Studio 2017 - Debugging Office Add-In Excel

I can't figure out how to get the DOM Explorer or JS Console to show on my Office Add-In I'm dev in VS 2017. They used to work and one day, just stopped.
So far I've tried the following:
Test Proj at home and copied source files to non working work computer
Removed 100% Visual Studio and re-installed
Started working w/ new template in VS 2017 vs my existing Project
Tried messing w/ .Net versions
Updated all available Nuget packages
Other settings too likely, I'm willing to start fresh if anyone has suggestions that don't work first try for me.
I'm at a loss what the issue could be. My Add-Ins load and behave correctly, but I can't see the DOM or JS console which is the whole reason I use VS 2017, any ideas what I can try?
I was able to resolve by uninstalling the Microsoft Edge WebView2 Runtime...

Could not find type 'Microsoft.Office.Tools.Ribbon.RibbonTab' error prevents designer from opening

I have a VSTO for Excel project with a custom ribbon tab. The solution builds without errors. I can run the solution. It launches Excel and displays the custom ribbon tab and task pane without any issue.
When I try to open the designer for the custom ribbon tab in Visual Studio 2019, I get the following error:
Could not find type 'Microsoft.Office.Tools.Ribbon.RibbonTab'. Please
make sure the assembly that contains this type is referenced. If this
type is a part of a development project, make sure that the project
has been successfully built using the settings for your current
platform or Any CPU.
The solution builds and runs without any issues.
When I expand the error info, There is no stack trace or error line information available for this error.
The build settings are set to 'Any CPU'.
The assemblies that contain 'Microsoft.Office.Tools.Ribbon.RibbonTab' are included in the project references. These are Microsoft.Office.Tools.Common and Microsoft.Office.Tools.Common.v4.0.Utilities.
I have tried to Clean, Rebuild, and Restart Visual Studio 2019. This had no effect.
I could not find anything definitive when I Check Windows Forms Design-Time error list.
Would anyone know how to address this issue so that I can open the custom ribbon in the designer?
Is VSTO still supported by Microsoft? All documentation appears to be several years old.
This is a Visual Studio issue, not a C#/Build/DLL linkage issue.
Make sure your Visual Studio setup (do the Modify in the installer (#1) if already installed) has these two components checked:
Is VSTO still supported by Microsoft?
They are moving to an online office365 addin (my words) type VSTO. As to new features, not recently. One can still put in a Visual Studio support ticket if you have the right subscription.
I have never had any issues with ribbons, but sometimes the winforms res files in designer do not show and I use the JetBrains Rider editor to view those controls when VS fails.

TF208071 Object reference Error from Excel with TFS reports

VS2017, Click "Create Report in Microsoft Excel", Excel 2016 opens, once I click Finish, throws this
"TF208071: The following error occurred when the command was generating PivotTable and PivotChart reports. Close the Microsoft Excel workbook and try again, or press F1 for more information.
Object reference not set to an instance of an object.
"
Recently upgraded TFS server to 2017, I can still generate the reports using Visual Studio 2012/2013 by connecting to the same TFS server. However not on VS2017.
Where do I start looking? None of the event logs show any such error.
I have 4 columns of data from the WI to export, so its not the amount of data.
Seems you are talking about create Excel reports from a work item query, try to clear TFS and VS cache and test again.
Besides, since you are using TFS2017 and VS2017, you could try to use this extension--VSTS Open in Excel, you could use this extension for bulk editing work items, or to leverage Excel tools to analyze and visualize a large number of work items. You could directly open work items in web portal.
Besides, as a workaround, you could still generate the reports using Visual Studio 2012/2013 by connecting to the same TFS server.
Hope it helps someone!
The issue is with the 2017 TFS COM Add-in, this has an issue used with Excel 2016. seems like a bug from Microsoft!
So we removed all the TFS addin from Excel2016. Then do a repair install of 2015 Office integration which will set V14 Com Add-in to load at start. Then it will export through VS2017 (using the 2015 COM IN)
You can also edit this through regedit, make the V14 OR V13 COM Add-in to load at startup by editing that specific TFS Addin to a value of 3 and setting all the rest to 0.

Outlook app - Debug in non-IE browser

I am creating an Office App (Outlook addin/web-app). While debugging, the app is always launching in IE desktop version. I want to start debugging the app in non-IE browser - FF, Chrome. I couldn't find any settings related to this within the project. How can I achieve that?
Any help will be appreciated.
Thanks.
Microsoft Visual Studio: Currently you will be able to debug you project in Visual studio 2015 or later only using IE browser. By "debugging in VS" I meant you set breakpoints directly in IDE for your JS code. As of VS2017 RC release you will be able to debug your project in two browsers (IE and Chrome), even today, Edge coming as well. Please see Client-side debugging of ASP.NET projects in Google Chrome.
If you need just to start your project in yet another browser (Chrome, Edge, Firefox) you need to use this article to switch your Browser in IDE: Testing with an Alternate Browser. After you switch to another browser, please restart VS; I have tried this myself and it works, your project will be started in the browser of your choice by pressing F5. With this approach you would need to debug your code with development tools of this browser (F12) or some 3rd party extension.
Visual Studio Code: (VS community edition) Looks like have support for debugging your code in Chrome and setting up break points directly in VS Code IDE. Please refer to Introducing Chrome Debugging for VS Code. You would require to install VS extension as described in the article.
Other options: If you are using yet another Tool please refer to the following blog about different methods of debugging office add-ins: The many ways of office web add-ins debugging
I finally figured out the solution. Select the Manifest project, hit F4 to open Properties window. Choose your preferred Start Action. Here is a screenshot.
Start Action image

Taskpane is not showing properly in Word 2016 Web Add-ins

I have created an Web Add-ins project for Word using Visual Studio.
I have Office 2016 Professional Plus installed on my system.
When I try to launch the application using F5. Everything works, but when I click on the button in the ribbon menu to show the task pane. Task pane is shown but with following error message.
ADD-IN ERROR
This add-in could not be started. Close this dialog to ignore the
problem or click "Restart" to try again.
UPDATE:
I have tried to create a new project/solution and without modifying anything. It is giving the same error on running or hitting F5.
UPDATE 2:
I have verified that I have Latest version of Office developer tools installed.
I shared the same application that I created with another colleague here and it did not run on his machine either, but when I tried to create a File->New Project on another machine (it worked there) and tried to run that on my system and it didn't work.
I was facing this issue because of a bad environment setup. After I uninstalled and then reinstalled Visual Studio, everything started working again, as suggested in #JuanBalmori's comment.

Resources