Dynamics 365 Business Central: Publish without debugging (Ctrl+F5) and Debug without publishing (Ctrl+Shift+F5)

Dynamics 365 Business Central

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:

F5Start debugging (Publish with debugging)
Ctrl+F5Start without debugging (Publish without debugging)
Ctrl+Shift+F5Start 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.

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!!!😁

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.

1. Dynamics 365 Business Central: How to set your custom Method (procedure) and Variable non-debuggable (NonDebuggable Attribute)

2. Business Central 2023 wave 2 (BC23): Open Visual Studio Code (Debugging) from web client to investigate or troubleshoot extensions

3. Business Central 2023 wave 1 (BC22): Attach AL debugger to active session or next session (Specific user)

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

6. Business Central 2022 wave 2 (BC21) new features: Resource exposure policies for apps are on by default (“allowDebugging”: true, “allowDownloadingSource”: true, “includeSourceInSymbolFile”: true)


Hope this will help.

Thanks for reading.



Copied title and URL