Hi, Readers.
Today I would like to share a mini tip about Business Central development, Publish without debugging (Ctrl+F5) and Debug without publishing (Ctrl+Shift+F5).
Debugging is the process of finding and correcting errors. With Visual Studio Code and the AL Language extension for Microsoft Dynamics 365 Business Central, you get an integrated debugger to help you inspect your code and verify that your application can run as expected. You can start a debugging session by pressing F5.
For more information about Debugging in Visual Studio Code, see Debugging and Debugging in AL
PS: To start writing extensions for Dynamics 365 Business Central, you need a Business Central tenant, Visual Studio Code, and the AL Language extension for Microsoft Dynamics 365 Business Central.
So did you know that there are two other modes available besides F5 (Publish with debugging), Publish without debugging (Ctrl+F5) and Debug without publishing (Ctrl+Shift+F5).
Debugging shortcuts:
Keystroke | Action |
---|---|
F5 | Start debugging (Publish with debugging) |
Ctrl+F5 | Start without debugging (Publish without debugging) |
Ctrl+Shift+F5 | Start debugging without publishing. (Debug without publishing) Using this command on a changed but unpublished code may trigger false existing breakpoints. For example, if you modify the method “foo”, add two lines, put a breakpoint on the second line, and then start debugging without publishing, that breakpoint won’t be hit, or if it’s hit isn’t your new code that it breaks. If it breaks, it will break on the line that the server thinks the breakpoint is, based on the last published code. |
Note
For some users the Ctrl+F5 or Ctrl+Shift+F5 shortcut key might not work due to keyboard or other settings. If it doesn’t work for you, run your code by choosing Run Without Debugging from the Run dropdown in Visual Studio Code.
Let’s look at two simple test videos.
1. Publish without debugging (Ctrl+F5): The extension was published successfully, but no debugging session was started. This is helpful when you just want to test the functionality without debugging.
2. Debug without publishing (Ctrl+Shift+F5): The extension is not published, but the debugging session is started. This is useful if you just want to debug standard functionality but don’t want to publish your current extension.
Very simple, give it a try!!!😁
Note
Extensions that have been published to a sandbox environment from Visual Studio Code or created Use Designer are removed when the sandbox environment is updated or relocated within our service. However, the data of an app is not removed, so you only have to re-publish and install the app to make it available.
Tips and tricks for AL Language:
- Use Ctrl+Space to activate IntelliSense at any place in the code, which helps you identify possible options.
- Always use the
.al
extension on new files. - Use the built-in snippets for code by typing
t
and choose the desired snippet from the list. - Create objects within the right object ranges, see Object Ranges in Dynamics 365 Business Central.
- Build and get inspired by our sample library on GitHub.
- Use Ctrl+Shift+P and select AL: Clear credentials cache to clear the credentials cache if you want to deploy against a different environment.
- Use F2 to rename objects, types etc. For more information, see Keyboard Shortcuts.
4. Dynamics 365 Business Central: Snapshot Debugging (Debugging in Cloud Production)
5. Dynamics 365 Business Central: Debugging Upgrade and Install code in Visual Studio Code
END
Hope this will help.
Thanks for reading.
ZHU
コメント