
Configuring the Visual Studio debugger
When the debugger is launched by using F5 from within Visual Studio, the default console you’ve set by using other Microsoft Game Development Kit (GDK) tools, such as XBOX Manager or xbConnect, is used by default. To override this behavior, specify a console by using the Remote IP Address property under the XBOX One section of a project’s property page as shown in the following screenshot.


Symbol paths
The Program Database (.pdb) files for several Game OS components are available for use when debugging with Visual Studio. Configuring Visual Studio to use these symbols provides more complete callstacks when broken into the debugger, for example. Some of the Game OS symbols are installed on your development PC by Microsoft Game Development Kit (GDK) setup, while others are available on the Microsoft public symbol servers. The Game OS symbols installed by setup are located on the development PC in C:\Program Files (x86)\Microsoft GDK<edition number>\GXDK\gameKit\symbols. Platform-independent .pdbs are in the root of the symbol folder. Platform-specific .pdbs are in the Xbox Series X|S and XboxOne subdirectories. To add the path to the Game OS symbol directory on your local PC, use the Symbols setting under the Debugging section of the Visual Studio Options dialog box as shown in the following screenshot.

Properties related to debugging
The debugger can be further configured through a set of properties that are exposed in the project properties dialog box and in the Settings tab of the XBOX Gaming Explorer. These properties include, for example, the ability to pass command-line arguments to your title and turn on log module loading. For details about the available properties, see Visual Studio Properties for XBOX Development and XBOX Gaming Explorer.Attaching to a running title
The XBOX menu and the XBOX Gaming Explorer include menu options for attaching the debugger to a game that’s running on a console. To attach to the game that’s currently running on your default console, use Attach to Running Game on the XBOX menu. The XBOX menu is accessible from the Visual Studio menu bar as shown in the following screenshot.


Although either the Host IP or the System IP address can be used to attach to a title, avoid mixing the two when attaching multiple times in a single session. For example, if you initially attach using the Host IP, continue to use the Host IP on subsequent attaches.

Debugging XBOX projects using Visual Studio 2022
Debugging with Visual Studio 2022 requires that the title being debugged is built with the October 2021 (or newer) Microsoft Game Development Kit (GDK). The dependency on the October 2021 (or newer) Microsoft Game Development Kit (GDK) exists because the Game OS that ships in those versions of the Microsoft Game Development Kit (GDK) contains binaries that are required for debugging with Visual Studio 2022. The following error is displayed if debugging with Visual Studio 2022 is attempted against an older Game OS.
Debugging packaged builds
In releases of the XBOX One Software Development Kit, the workflow for debugging packaged builds involved using the Debug Installed App Packages menu item in Visual Studio. This workflow has been significantly simplified in the September 2019 release of the Microsoft Game Development Kit (GDK) as described in this section.

Debugging transitions between Game Lifecycle states
Properly supporting Game Lifecycle requires you to write event handlers for the transitions between the full, suspended and constrained lifecycle states. Visual Studio provides several features to help you write the robust event handlers required for your title to successfully pass through the Game Lifecycle state transitions. The context menus in XBOX Gaming Explorer include options to Suspend, Resume and Constrain your title so you can debug your handlers on a dev kit.

C++ Dynamic Debugging in Visual Studio 2022
C++ Dynamic Debugging is a new debugging feature that offers a full debugging experience for optimized code without compromising performance. Place deoptimized breakpoints and step in anywhere with on-demand function deoptimization. To activate C++ Dynamic Debugging: Right-click on your project, Properties > Configuration Properties > Advanced > Advanced Properties > Use C++ Dynamic Debugging (preview). Version 17.14 Preview 2 or newer of Visual Studio 2022 is required to use the dynamic debugging feature. Goto https://aka.ms/dynamicdebugging to learn more.The version of Visual Studio required to use C++ Dynamic Debugging (version 17.14) is scheduled to release after the April 2025 GDK. After version 17.14 of Visual Studio releases, a GDK update will be released that contains the C++ debug monitor (msvsmon.exe) required for C++ Dynamic Debugging. If you wish to use C++ Dynamic Debugging before that GDK update is released, contact your Microsoft account manager for instructions describing how to load the appropriate version of the C++ debug monitor onto your console.
