microsoft / microsoft/AL

Global app.json preprocessor symbols are ignored when publishing to 2026 Wave 2 (NextMajor)

Open
#8,300 2 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

accepted
Dominant language
PowerShell
Stars
881
Forks
285
Avg merge
3d 36m
Merged PRs (30d)
1

Description

1. Describe the bug
Preprocessor symbols defined globally in app.json are ignored when an extension is published to Business Central 2026 Wave 2 NextMajor / BC29.

The same symbol works correctly when defined at object level with #define. The extension compiles and publishes without errors but the published code behaves as though the global symbol was not defined.

This issue reproduces with:

  • Local sandbox image: sandbox/29.0.52799.0/de

  • BC Online Preview environment on BC29

  • AL Language pre-release extension 18.0.2498801

  • AL Compiler 18.0.38.8509

  • AL Language package included in the BC29 sandbox image

  • AL Compiler 18.0.39.10160

All other Visual Studio Code extensions were disabled except AL Language.

2. To Reproduce

  1. In Visual Studio Code, use AL: Go! to create a new sample project.
  2. Use the default HelloWorld.al page extension and replace its contents with the following:
pageextension 50100 CustomerListExt extends "Customer List"
{
    trigger OnOpenPage();
    begin
        #if TEST
            Message('TEST symbol is defined');
        #else
            Message('TEST symbol is NOT defined');
        #endif
    end;
}
  1. Add the following property to app.json:
{
    "preprocessorSymbols": [
        "TEST"
    ]
}
  1. Publish the extension to a BC29 environment.
  2. Open the Customer List page.
  3. The message displayed is: "TEST symbol is NOT defined"
  4. Now add the following line at the beginning of HelloWorld.al:
#define TEST
  1. Publish the extension again and open the Customer List page.
  2. The message now displayed is: "TEST symbol is defined"

3. Expected behavior
The preprocessor symbol declared in app.json should be available globally to all AL source files in the extension.
With this configuration:

"preprocessorSymbols": [
    "TEST"
]

the #if TEST branch should be included in the compiled extension, and opening the Customer List page should display: "TEST symbol is defined"

4. Actual behavior
The extension compiles and publishes without an error, but the global symbol defined in app.json is ignored. The published extension executes the #else branch and displays: "TEST symbol is NOT defined"
Adding the same symbol directly to the source file with:

#define TEST

causes the expected branch to be selected.

The issue reproduces in both:

A local BC29 sandbox using image sandbox/29.0.52799.0/de
A BC Online Preview environment running BC29

5. Versions:

  • AL Language: 18.0.2498801
  • Visual Studio Code: 1.129.1
  • Business Central: 29.0.52799.0
  • List of Visual Studio Code extensions that you have installed: AL Language only during reproduction
  • Operating System:
    • Windows
    • Linux
    • MacOS
Final Checklist

Please remember to do the following:

  • Search the issue repository to ensure you are reporting a new issue
  • Reproduce the issue after disabling all extensions except the AL Language extension
  • Simplify your code around the issue to better isolate the problem

Internal work item: AB#646500

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with app.json and HelloWorld.al in a BC29 environment, using the AL Language extension and compiler versions listed. Compare publishing with the global preprocessorSymbols entry against the object-level #define TEST case. Done means the app.json symbol selects the #if TEST branch after publishing, in both the local sandbox and BC Online Preview scenarios.

Written by the indexing model from the issue text.

Assessment

Tech stack
vscode
Domain
compilers, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.