The process of finding and correcting errors is called debugging. With Visual Studio Code and the AL Language extension you get an integrated debugger to help you inspect your code to verify that your application can run as expected. You start a debugging session by pressing F5.
For more information about Debugging in Visual Studio Code, see Debugging.
To enable debugging the
NetFx40_LegacySecurityPolicy setting in the Microsoft.Dynamics.Nav.Server.exe.config file must be set to false. This requires a server restart.
For the preview, there are a number of limitations to be aware of:
- “External code” can only be debugged if the code has the
ShowMyCodeflag set. For more information, see Security Setting and IP Protection.
- Not all AL types yet show helpful debugging.
- The debugger launches a new client instance each time you press F5. If you close the debugging session, and then start a new session, this new session will rely on a new client instance. We recommend that you close the Web client instances when you close a debugging session.
- And finally, using the debugger with the online sandbox signup and AAD authentication method is not yet supported.
The basic concept in debugging is the breakpoint, which is a mark that you set on a statement. When the program flow reaches the breakpoint, the debugger stops execution until you instruct it to continue. Without any breakpoints, the code runs without interruption when the debugger is active. Set a breakpoint by using the Debug Menu in Visual Studio Code.
|Ctrl+F5||Start without debugging|
For more shortcuts, see Debugging.