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
- In Visual Studio Code, use AL: Go! to create a new sample project.
- 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;
}
- Add the following property to app.json:
{
"preprocessorSymbols": [
"TEST"
]
}
- Publish the extension to a BC29 environment.
- Open the Customer List page.
- The message displayed is: "TEST symbol is NOT defined"
- Now add the following line at the beginning of HelloWorld.al:
- Publish the extension again and open the Customer List page.
- 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:
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:
Final Checklist
Please remember to do the following:
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
{ "preprocessorSymbols": [ "TEST" ] }#define TEST3. Expected behavior
The preprocessor symbol declared in app.json should be available globally to all AL source files in the extension.
With this configuration:
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 TESTcauses 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:
Final Checklist
Please remember to do the following: