Skip to content

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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions