Dynamics 365 Business Central: attaching VS Code Debugger from client

One of the long awaited feature that you will see in Dynamics 365 Business Central 2023 Wave 2 release (v23) is the ability to oen a Visual Studio Code debugging session from within the web client for a specific customer production or sandbox environment.

To simplify and speed up this process, a new option to open a local Visual Studio Code instance for the current extension and environment will be added to the web client, allowing just a single click to set up a matching VS Code project for investigation or troubleshooting.

The new feature supports two different contexts:

  • You can use the new Attach debugger to this session action from the Help and Support page to troubleshoot the current session.
  • You can use the new Explore page in Visual Studio Code action from within the Page Inspector.

The first possible option is to start a debugging session from the Help and Support page:

The action will ask you to open a Visual Studio Code session and a new AL project will be generated attached to the current session:

From here you can immediately download symbols, select the debugging type to perform and start working. No more configurations to manually perform on Visual Studio Code now.

The second possibility to start debuggins is from the Page Inspection page:

A new AL project for debugging will be generated as previusly explained.

Please remember the following:

  • If Visual Studio Code is already open, the last active session will be used; otherwise, a new Visual Studio Code will open. If the AL Language extension isn’t installed, the user will be asked to install it, and the process ends.
  • The user will be asked if they want to investigate, or debug sandbox or production.
  • A new project will be created, and a matching launch configuration will be created, depending on production or sandbox environment.
  • If the user chooses to investigate, symbols for the invoked page will be added and the AL Explorer will open to easily allow browsing objects.
  • If the user chooses to debug, Visual Studio Code will attach to the web client process, which it was invoked from and await breaking on error.
  • In both cases, access to the source code will be gated by the resource exposure profile settings for each extension.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.