Skip to content

Commit 521f12b

Browse files
[all hosts] (Event based activation) Update debugging articles to reflect cross-host support (#5284)
* Update article to reflect general debugging steps for autorun * Style fixes * Apply suggestions from code review Co-authored-by: Sam Ramon <[email protected]> --------- Co-authored-by: Sam Ramon <[email protected]>
1 parent 99c8202 commit 521f12b

File tree

4 files changed

+37
-28
lines changed

4 files changed

+37
-28
lines changed

docs/includes/office-bundle-js.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
> [!TIP]
2+
>
3+
> - For readability, this article refers to the file name as **bundle.js**, but exact name depends on the Office application.
4+
> - Excel: **bundle_excel.js**
5+
> - Outlook: **bundle.js**.
6+
> - PowerPoint: **bundle_powerpoint.js**
7+
> - Word: **bundle_word.js**
8+
> - There's no direct method to determine the Office profile GUID and account encoding used in the **bundle.js** file path. The most effective approach to locate your add-in's **bundle.js** file is to manually inspect each folder until you locate the **Javascript** folder that contains your add-in's ID.
9+
> - The **bundle.js** file is downloaded to the local **Wef** folder when the add-in is first installed. It's refreshed every time the Office application starts or is restarted. If the **bundle.js** file doesn't appear in the **Wef** folder and your add-in is installed or sideloaded, restart Office. For Outlook, you may need to [remove your add-in](../outlook/sideload-outlook-add-ins-for-testing.md#remove-a-sideloaded-add-in), then [sideload](../outlook/sideload-outlook-add-ins-for-testing.md) it again.

docs/includes/outlook-bundle-js.md

Lines changed: 0 additions & 4 deletions
This file was deleted.

docs/testing/debug-autolaunch.md

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Debug event-based or spam-reporting add-ins
33
description: Learn how to debug your Office Add-ins that implement event-based activation or integrated spam reporting.
4-
ms.date: 01/28/2025
4+
ms.date: 07/15/2025
55
ms.topic: how-to
66
ms.localizationpriority: medium
77
---
@@ -18,7 +18,7 @@ Use your preferred browser's developer tools to debug your event-based add-in in
1818

1919
# [Windows (new)](#tab/new-windows)
2020

21-
To debug your add-in in [new Outlook on Windows desktop client](https://support.microsoft.com/office/656bb8d9-5a60-49b2-a98b-ba7822bc7627), you must run the following command to open Microsoft Edge DevTools.
21+
To debug your add-in in [new Outlook on Windows desktop client](https://support.microsoft.com/office/656bb8d9-5a60-49b2-a98b-ba7822bc7627), run the following command to open Microsoft Edge DevTools.
2222

2323
```command&nbsp;line
2424
olk.exe --devtools
@@ -51,14 +51,14 @@ If you used the [Yeoman generator for Office Add-ins](../develop/yeoman-generato
5151
5252
[!include[Developer registry key](../includes/developer-registry-key.md)]
5353
54-
1. In the registry key `HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\Wef\Developer\[Add-in ID]`, where `[Add-in ID]` is your add-in's ID from the manifest, create a new `DWORD` value with the following configuration.
54+
1. In the registry key `HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\WEF\Developer\[Add-in ID]`, where `[Add-in ID]` is your add-in's ID from the manifest, create a new `DWORD` value with the following configuration.
5555
5656
- **Value name**: `DebuggerPort`
5757
- **Value data (hexadecimal)**: `00002407`
5858
5959
This sets the debugger port to `9223`.
6060
61-
1. Start Outlook or restart it if it's already open.
61+
1. Start your Office application or restart it if it's already open.
6262
1. Perform the action to initiate the event you're developing for, such as creating a new message to initiate the `OnNewMessageCompose` event or reporting spam messages. The **Debug Event-based handler** dialog should appear. Do *not* interact with the dialog yet.
6363
6464
![The Debug Event-based handler dialog in Windows.](../images/outlook-win-autolaunch-debug-dialog.png)
@@ -77,10 +77,14 @@ You can debug your add-in using the Microsoft Edge Inspect tool or Visual Studio
7777
> [!NOTE]
7878
> It may take some time for your add-in to appear in the **Remote Target** section. You may need to refresh the page for the add-in to appear.
7979
80-
1. In the **Sources** tab, go to **file://** > **Users/[User]/AppData/Microsoft/Office/16.0/Wef/{[Outlook profile GUID]}/[Outlook mail account encoding]/Javascript/[Add-in ID]\_[Add-in Version]_[locale]** > **bundle.js**.
80+
1. In the **Sources** tab, go to **file://** > **Users/[User]/AppData/Local/Microsoft/Office/16.0/Wef/{[Office profile GUID]}/[Office account encoding]/Javascript/[Add-in ID]\_[Add-in Version]_[locale]** > **bundle.js**. For readability, this article refers to the file name as **bundle.js**, but exact name depends on the Office application.
81+
- Excel: **bundle_excel.js**
82+
- Outlook: **bundle.js**
83+
- PowerPoint: **bundle_powerpoint.js**
84+
- Word: **bundle_word.js**
8185
8286
> [!TIP]
83-
> There's no direct method to determine the Outlook profile GUID or mail account encoding used in the **bundle.js** file path. If you're debugging multiple add-ins simultaneously, the easiest way to access an add-in's **bundle.js** file from the DevTools window is to locate the add-in's ID in the file path.
87+
> There's no direct method to determine the Office profile GUID or mail account encoding used in the **bundle.js** file path. If you're debugging multiple add-ins simultaneously, the easiest way to access an add-in's **bundle.js** file from the DevTools window is to locate the add-in's ID in the file path.
8488
8589
1. In the **bundle.js** file, place breakpoints where you want the debugger to stop.
8690
1. [Run the debugger](#run-the-debugger).
@@ -118,7 +122,7 @@ Configure the debugger in Visual Studio Code. Follow the steps applicable to you
118122
119123
1. Create a new folder called **Debugging** (perhaps in your **Desktop** folder).
120124
1. Open Visual Studio Code.
121-
1. Go to **File** > **Open Folder**, navigate to the folder you just created, then choose **Select Folder**.
125+
1. Go to **File** > **Open Folder**, navigate to the folder you created, then choose **Select Folder**.
122126
1. On the Activity Bar, select **Run and Debug** (<kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>D</kbd>).
123127
124128
![The Run and Debug icon on the Activity Bar.](../images/vs-code-debug.png)
@@ -143,15 +147,15 @@ Configure the debugger in Visual Studio Code. Follow the steps applicable to you
143147
144148
#### Attach the debugger
145149
146-
The **bundle.js** file of an add-in contains the JavaScript code of your add-in. It's created when classic Outlook on Windows is opened. When Outlook starts, the **bundle.js** file of each installed add-in is cached in the **Wef** folder of your machine.
150+
The **bundle.js** file of an add-in contains the JavaScript code of your add-in. It's created when an Office on Windows application is opened. When Office starts, the **bundle.js** file of each installed add-in is cached in the **Wef** folder of your machine.
147151
148-
1. To find the add-in's **bundle.js** file, navigate to the following folder in File Explorer. The text enclosed in `[]` represents your applicable Outlook and add-in information.
152+
1. To find the add-in's **bundle.js** file, navigate to the following folder in File Explorer. The text enclosed in `[]` represents your applicable Office and add-in information.
149153
150154
```text
151-
%LOCALAPPDATA%\Microsoft\Office\16.0\Wef\{[Outlook profile GUID]}\[Outlook mail account encoding]\Javascript\[Add-in ID]_[Add-in Version]_[locale]
155+
%LOCALAPPDATA%\Microsoft\Office\16.0\Wef\{[Office profile GUID]}\[Office account encoding]\Javascript\[Add-in ID]_[Add-in Version]_[locale]
152156
```
153157
154-
[!INCLUDE [outlook-bundle-js](../includes/outlook-bundle-js.md)]
158+
[!INCLUDE [office-bundle-js](../includes/office-bundle-js.md)]
155159
156160
1. Open **bundle.js** in Visual Studio Code.
157161
1. Place breakpoints in **bundle.js** where you want the debugger to stop.
@@ -161,29 +165,29 @@ The **bundle.js** file of an add-in contains the JavaScript code of your add-in.
161165
162166
## Run the debugger
163167
164-
After confirming that the debugger is attached, return to Outlook. In the **Debug Event-based handler** dialog, choose **OK** .
168+
After confirming that the debugger is attached, return to the Office application. In the **Debug Event-based handler** dialog, select **OK**.
165169
166-
You can now hit your breakpoints to debug your event-based activation or spam-reporting code.
170+
You can now reach your breakpoints to debug your event-based activation or spam-reporting code.
167171
168172
> [!IMPORTANT]
169173
> Starting in Version 2403 (Build 17425.20000), event-based and spam-reporting add-ins use the [V8 JavaScript engine](https://v8.dev/) to run JavaScript, regardless of whether debugging is turned on or off. In earlier versions, the Chakra JavaScript engine is used when debugging is off, but the V8 engine may be used when debugging is turned on.
170174
171175
## Stop the debugger
172176
173-
To stop debugging the rest of the current Outlook on Windows session, in the **Debug Event-based handler** dialog, choose **Cancel**. To re-enable debugging, restart Outlook.
177+
To stop debugging the rest of the current Office on Windows session, in the **Debug Event-based handler** dialog, choose **Cancel**. To re-enable debugging, restart the Office application.
174178
175-
To prevent the **Debug Event-based handler** dialog from popping up and stop debugging for subsequent Outlook sessions, delete the associated registry key, `HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\Wef\Developer\[Add-in ID]\UseDirectDebugger`, or set its value to `0`.
179+
To prevent the **Debug Event-based handler** dialog from popping up and stop debugging for subsequent sessions, delete the associated registry key, `HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\WEF\Developer\[Add-in ID]\UseDirectDebugger`, or set its value to `0`.
176180
177181
## Stop the local server
178182
179183
[!include[Instructions to stop web server and uninstall dev add-in](../includes/stop-uninstall-outlook-dev-add-in.md)]
180184
181185
# [Mac](#tab/mac)
182186
183-
Event-based add-ins that run in Outlook on Mac use the browser runtime. Because of this, you can debug your add-in using Safari Web Inspector.
187+
Event-based add-ins that run in Office on Mac use the browser runtime. Because of this, you can debug your add-in using Safari Web Inspector.
184188
185-
1. To use the Safari Web Inspector in Outlook, follow the steps in [Debugging with Safari Web Inspector on a Mac](debug-office-add-ins-on-ipad-and-mac.md#debugging-with-safari-web-inspector-on-a-mac).
186-
1. Open Outlook, then [sideload your add-in](../outlook/sideload-outlook-add-ins-for-testing.md).
189+
1. To use the Safari Web Inspector in Office, follow the steps in [Debugging with Safari Web Inspector on a Mac](debug-office-add-ins-on-ipad-and-mac.md#debugging-with-safari-web-inspector-on-a-mac).
190+
1. Open Office, then [sideload your add-in](../testing/test-debug-office-add-ins.md#sideload-an-office-add-in-for-testing).
187191
1. Perform an action that will initiate the event your add-in handles. For example, create a new message to initiate the `OnNewMessageCompose` event. This opens an empty Developer Window. The name of your add-in appears in the title bar of the window.
188192
1. Right-click (or select and hold) anywhere in the Developer Window, then select **Inspect Element**. This opens the Inspector, where you can set breakpoints and debug your add-in.
189193

docs/testing/troubleshoot-event-based-and-spam-reporting-add-ins.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Troubleshoot event-based and spam-reporting add-ins
33
description: Learn how to troubleshoot development errors in Office Add-ins that implement event-based activation or integrated spam reporting.
4-
ms.date: 07/02/2025
4+
ms.date: 07/15/2025
55
ms.topic: troubleshooting
66
ms.localizationpriority: medium
77
---
@@ -44,9 +44,9 @@ As you develop your [event-based](../develop/event-based-activation.md) or [spam
4444

4545
- As you make changes to your add-in, be aware that:
4646
- If you update the manifest, remove the add-in, then sideload it again. For information on how to remove a sideloaded add-in from Outlook, see [Sideload Outlook add-ins for testing](../outlook/sideload-outlook-add-ins-for-testing.md#remove-a-sideloaded-add-in). If you're using Outlook on Windows, you must also close and reopen Outlook.
47-
- If you make changes to files other than the manifest, close and reopen the Outlook client on Windows or on Mac, or refresh the browser tab running Outlook on the web.
47+
- If you make changes to files other than the manifest, close and reopen the Office client on Windows or on Mac, or refresh the browser tab running Office on the web.
4848
- If you're still unable to see your changes after performing these steps, [clear your Office cache](../testing/clear-cache.md).
49-
- As you test your add-in in classic Outlook on Windows:
49+
- As you test your add-in in Office on Windows (excluding the new Outlook on Windows):
5050
- For event-based add-ins, check [Event Viewer](/shows/inside/event-viewer) for any reported add-in errors.
5151
1. In Event Viewer, select **Windows Logs** > **Application**.
5252
1. From the **Actions** panel, select **Filter Current Log**.
@@ -57,13 +57,13 @@ As you develop your [event-based](../develop/event-based-activation.md) or [spam
5757

5858
:::image type="content" source="../images/outlook-event-based-logs.png" alt-text="A sample of Event Viewer's Filter Current Log settings configured to only show Outlook errors with event ID 63 that occurred in the last hour.":::
5959

60-
- Verify that the **bundle.js** file is downloaded to the following folder in File Explorer. The text enclosed in `[]` represents your applicable Outlook and add-in information.
60+
- Verify that the **bundle.js** file is downloaded to the following folder in File Explorer. The text enclosed in `[]` represents your applicable Office and add-in information.
6161

6262
```text
63-
%LOCALAPPDATA%\Microsoft\Office\16.0\Wef\{[Outlook profile GUID]}\[Outlook mail account encoding]\Javascript\[Add-in ID]_[Add-in Version]_[locale]
63+
%LOCALAPPDATA%\Microsoft\Office\16.0\Wef\{[Office profile GUID]}\[Office account encoding]\Javascript\[Add-in ID]_[Add-in Version]_[locale]
6464
```
6565

66-
[!INCLUDE [outlook-bundle-js](../includes/outlook-bundle-js.md)]
66+
[!INCLUDE [office-bundle-js](../includes/office-bundle-js.md)]
6767

6868
- As you test your add-in on desktop clients (excluding new Outlook on Windows) enable runtime logging to identify possible manifest and add-in installation issues. For guidance on how to use runtime logging, see [Debug your add-in with runtime logging](../testing/runtime-logging.md).
6969
- Set breakpoints in your code to debug your add-in. For platform-specific instructions, see [Debug event-based and spam-reporting add-ins](debug-autolaunch.md).

0 commit comments

Comments
 (0)