You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[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]>
> - 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.
Copy file name to clipboardExpand all lines: docs/testing/debug-autolaunch.md
+22-18Lines changed: 22 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: Debug event-based or spam-reporting add-ins
3
3
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
5
5
ms.topic: how-to
6
6
ms.localizationpriority: medium
7
7
---
@@ -18,7 +18,7 @@ Use your preferred browser's developer tools to debug your event-based add-in in
18
18
19
19
# [Windows (new)](#tab/new-windows)
20
20
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.
22
22
23
23
```command line
24
24
olk.exe --devtools
@@ -51,14 +51,14 @@ If you used the [Yeoman generator for Office Add-ins](../develop/yeoman-generato
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.
55
55
56
56
- **Value name**: `DebuggerPort`
57
57
- **Value data (hexadecimal)**: `00002407`
58
58
59
59
This sets the debugger port to `9223`.
60
60
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.
62
62
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.
63
63
64
64

@@ -77,10 +77,14 @@ You can debug your add-in using the Microsoft Edge Inspect tool or Visual Studio
77
77
> [!NOTE]
78
78
> 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.
79
79
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**
81
85
82
86
> [!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.
84
88
85
89
1. In the **bundle.js** file, place breakpoints where you want the debugger to stop.
86
90
1. [Run the debugger](#run-the-debugger).
@@ -118,7 +122,7 @@ Configure the debugger in Visual Studio Code. Follow the steps applicable to you
118
122
119
123
1. Create a new folder called **Debugging** (perhaps in your **Desktop** folder).
120
124
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**.
122
126
1. On the Activity Bar, select **Run and Debug** (<kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>D</kbd>).
123
127
124
128

@@ -143,15 +147,15 @@ Configure the debugger in Visual Studio Code. Follow the steps applicable to you
143
147
144
148
#### Attach the debugger
145
149
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.
147
151
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.
149
153
150
154
```text
151
-
%LOCALAPPDATA%\Microsoft\Office\16.0\Wef\{[Outlook profile GUID]}\[Outlook mail account encoding]\Javascript\[Add-in ID]_[Add-in Version]_[locale]
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.
161
165
162
166
## Run the debugger
163
167
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**.
165
169
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.
167
171
168
172
> [!IMPORTANT]
169
173
> 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.
170
174
171
175
## Stop the debugger
172
176
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.
174
178
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`.
176
180
177
181
## Stop the local server
178
182
179
183
[!include[Instructions to stop web server and uninstall dev add-in](../includes/stop-uninstall-outlook-dev-add-in.md)]
180
184
181
185
# [Mac](#tab/mac)
182
186
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.
184
188
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).
187
191
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.
188
192
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.
Copy file name to clipboardExpand all lines: docs/testing/troubleshoot-event-based-and-spam-reporting-add-ins.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: Troubleshoot event-based and spam-reporting add-ins
3
3
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
5
5
ms.topic: troubleshooting
6
6
ms.localizationpriority: medium
7
7
---
@@ -44,9 +44,9 @@ As you develop your [event-based](../develop/event-based-activation.md) or [spam
44
44
45
45
- As you make changes to your add-in, be aware that:
46
46
- 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.
48
48
- 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-ininclassic Outlook on Windows:
49
+
- As you test your add-ininOffice on Windows (excluding the newOutlook on Windows):
50
50
- For event-based add-ins, check [Event Viewer](/shows/inside/event-viewer) for any reported add-in errors.
51
51
1. In Event Viewer, select **Windows Logs**>**Application**.
52
52
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
57
57
58
58
:::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.":::
59
59
60
-
- Verify that the **bundle.js** file is downloaded to the following folder inFileExplorer. 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 inFileExplorer. The text enclosed in`[]` represents your applicable Office and add-in information.
61
61
62
62
```text
63
-
%LOCALAPPDATA%\Microsoft\Office\16.0\Wef\{[Outlook profile GUID]}\[Outlook mail account encoding]\Javascript\[Add-in ID]_[Add-in Version]_[locale]
- As you test your add-in on desktop clients (excluding newOutlook 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-inwith runtime logging](../testing/runtime-logging.md).
69
69
-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