Edit

Debug extension installation and upgrade

Use an attach debugging session to test and troubleshoot install and upgrade codeunits when an extension is installed or upgraded.

Attach and debug

  1. In Visual Studio Code, configure launch.json with request set to attach. Make sure that useSystemSessionForDeployment is false, which is the default. When it's true, install and upgrade codeunits run in a system session and can't be debugged.
  2. Add breakpoints to the install or upgrade code that you want to debug.
  3. Press F5 to start the attach debugging session.
  4. After the debugger attaches, press Ctrl+F5 to run Publish extension without building.

If you don't increment the app version, the install codeunits run. If you increment the app version or set forceUpgrade to true in launch.json, the upgrade codeunits run.

Learn more about attach configurations in Attach and debug next. Learn more about setting breakpoints in Debugging in AL.

Debugging
Snapshot Debugging
Attach and Debug Next