Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
To test and troubleshoot issues in install and upgrade code, it's important to ensure that these processes run smoothly when the app is installed for the first time or when it's upgraded. You can add breakpoints in the install or upgrade code, and then attach and trigger publishing of an extension to debug these scenarios.
Attach and debug
- In Visual Studio Code, ensure that you've a
launch.json
file with therequest
option set toattach
. For more information, see Attach and Debug Next. - Add one or more breakpoints in the code that you want to debug. For more information, see Debugging.
Note
If you don't increment the version of the app, the install codeunits will not be invoked. If you do increment the version of the app, or if you set the
forceUpgrade
flag totrue
in thelaunch.json
file, the upgrade codeunits will be invoked. - If your app isn't yet published, then use Ctrl+F5 to publish the app file first; the
attach
option won't publish the app. After, start the attach session as you would normally start the debugging session with F5.