topic hubAdministration & Setupofficial - Microsoftunreviewed - model text not yet checked

Compile, publish, and debug

Compiling, publishing, debugging and profiling AL extensions for Business Central in Visual Studio Code. It answers questions about breakpoints, attach and snapshot debugging, the AL Profiler, compilation scope, app signing, Entra authentication on-premises and RAD publishing.

Path: Development > Development environment > Compile, publish, and debug · tier official · system administration · narrative unreviewed (model text not yet checked)

Overview

This section covers the daily build and troubleshoot loop for AL developers. It includes compile settings (compilation scope with OnPrem or Cloud target levels, and Rapid Application Development publishing with delta compilation), debugging tools, performance analysis, and packaging.

The debugging pages build on each other. Start with “Debug AL Code in Visual Studio Code” for breakpoints, break on errors and record changes. Then go to conditional breakpoints, attach and debug next (for sessions not launched from VS Code), debugging install and upgrade code, and snapshot debugging for recording on a server and inspecting offline. The MCP Server for AL page covers AI-assisted analysis of call stacks and variables with GitHub Copilot. Another page covers starting a VS Code debugging session directly from the web client.

Other pages cover the AL Profiler for finding performance hot spots, signing app package files with Azure Key Vault or PFX certificates, and using Microsoft Entra authentication for on-premises and container servers from VS Code.

Key points

  • The AL Profiler records in instrumentation or sampling mode, set in launch.json, and shows call stacks, timings and SQL calls in VS Code, with CodeLens timings.
  • Attach and debug next uses breakOnNext to attach to web client, web service, background or agent sessions, and can target a sessionId or userId.
  • Conditional breakpoints pause only when a condition is true, with comparison and logical operators (version 26).
  • Snapshot debugging records execution on the server using snappoints and replays it offline in VS Code. An AI agent can do this through the MCP server.
  • Install and upgrade codeunits can be debugged with attach debugging and by publishing without building.
  • Compilation scope is set with ExtensionAllowedTargetLevel on the server and the target property in the manifest (OnPrem or Cloud). It controls which APIs and .NET types are available.
  • App packages are signed with Azure Key Vault or a PFX file, using managed identity or service principal authentication. Self-signed certificates are for testing only, and Marketplace submission has certificate requirements.
  • RAD publishing uses delta compilation, a .rad file and rad.json to shorten build and publish times for large projects.

Learn pages

Videos, posts and code changes

Linked by a Haiku matcher with a grounding quote from the item’s summary (link/topics.ts); machine-generated.

Source: Microsoft Learn (CC BY 4.0). Descriptions are Learn’s own.

What Learn documents here 8 of 12 Learn pages

Show 4 more