Summary
When an AL project targets OnPrem and declares .NET assemblies, al_build and al_compile fail because the compiler receives an empty assembly probing path list, even though al.assemblyProbingPaths is configured and the assemblies are present on disk.
Invoking alc.exe directly with /assemblyprobingpaths compiles the same project cleanly, which suggests the value simply isn't being forwarded when the build is invoked through the agent tools.
Environment
- AL Language extension: 17.0.2273547
- AL Compiler: 17.0.34.45391
- Agent tooling: AL MCP Server (
al_build, al_compile, al_getdiagnostics, al_getpackagedependencies, al_auth_login)
- OS: Windows 11
app.json: "target": "OnPrem", "runtime": "16.0", "platform": "27.0.41766.0", "application": "27.1.41698.41776"
- The project declares several assemblies in a
dotnet block (for example Microsoft.Data.SqlClient and WinSCPnet). All of them are present under .netpackages.
Steps to reproduce
- Create/open an AL project with
"target": "OnPrem" and a dotnet block declaring an assembly available in .netpackages.
- Configure
al.assemblyProbingPaths (workspace folder settings, .code-workspace, or user settings — we have it in all three).
- Invoke
al_build (or al_compile) through the AL MCP Server.
Expected
The build resolves the declared assemblies, as it does when building from Visual Studio Code.
Actual
AL0451: An assembly named 'Microsoft.Data.SqlClient, PublicKeyToken=null'
could not be found in the assembly probing paths ''
Note the empty '' at the end. The same error is reported for each declared assembly, and cascades into follow-up errors wherever those types are used:
AL0185: DotNet 'SqlCommand' is missing
AL0185: DotNet 'Session' is missing
AL0185: DotNet 'ZipArchive' is missing
Every error reported for the project traces back to the unresolved assemblies.
Evidence that the configuration and the assemblies are fine
Invoking the same compiler binary manually, with the probing paths passed explicitly:
alc.exe /project:<project>
/packagecachepath:<project>\.alpackages
/assemblyprobingpaths:"<project>\.netpackages","C:\Windows\assembly","C:\Windows\Microsoft.NET\assembly\GAC_MSIL"
/out:<out.app>
completes with zero errors and produces a valid .app. Same compiler, same source, same symbol packages — the only difference is the /assemblyprobingpaths argument.
Building the same project from Visual Studio Code also works normally.
What we tried
al_build with and without projectPath
al_build with scope: "current" and scope: "all"
al_compile
- Reloading the VS Code window after editing the setting
All produce the same empty probing path list.
Impact
Any OnPrem project that uses dotnet cannot be built or validated through the agent tools. This is still common in Business Central solutions — SFTP clients, PDF utilities, SQL access. Cloud-target projects without dotnet build correctly, so the issue appears specific to this scenario.
Possible resolutions
Either of these would address it:
- Forward the resolved
al.assemblyProbingPaths value to the compiler when al_build / al_compile are invoked.
- Expose
assemblyProbingPaths as an optional parameter on al_build and al_compile, so an agent can supply it explicitly when the setting isn't discoverable — this would also help in headless/CI scenarios, where there is no VS Code workspace to read the setting from.
Summary
When an AL project targets
OnPremand declares .NET assemblies,al_buildandal_compilefail because the compiler receives an empty assembly probing path list, even thoughal.assemblyProbingPathsis configured and the assemblies are present on disk.Invoking
alc.exedirectly with/assemblyprobingpathscompiles the same project cleanly, which suggests the value simply isn't being forwarded when the build is invoked through the agent tools.Environment
al_build,al_compile,al_getdiagnostics,al_getpackagedependencies,al_auth_login)app.json:"target": "OnPrem","runtime": "16.0","platform": "27.0.41766.0","application": "27.1.41698.41776"dotnetblock (for exampleMicrosoft.Data.SqlClientandWinSCPnet). All of them are present under.netpackages.Steps to reproduce
"target": "OnPrem"and adotnetblock declaring an assembly available in.netpackages.al.assemblyProbingPaths(workspace folder settings,.code-workspace, or user settings — we have it in all three).al_build(oral_compile) through the AL MCP Server.Expected
The build resolves the declared assemblies, as it does when building from Visual Studio Code.
Actual
Note the empty
''at the end. The same error is reported for each declared assembly, and cascades into follow-up errors wherever those types are used:Every error reported for the project traces back to the unresolved assemblies.
Evidence that the configuration and the assemblies are fine
Invoking the same compiler binary manually, with the probing paths passed explicitly:
completes with zero errors and produces a valid
.app. Same compiler, same source, same symbol packages — the only difference is the/assemblyprobingpathsargument.Building the same project from Visual Studio Code also works normally.
What we tried
al_buildwith and withoutprojectPathal_buildwithscope: "current"andscope: "all"al_compileAll produce the same empty probing path list.
Impact
Any OnPrem project that uses
dotnetcannot be built or validated through the agent tools. This is still common in Business Central solutions — SFTP clients, PDF utilities, SQL access. Cloud-target projects withoutdotnetbuild correctly, so the issue appears specific to this scenario.Possible resolutions
Either of these would address it:
al.assemblyProbingPathsvalue to the compiler whenal_build/al_compileare invoked.assemblyProbingPathsas an optional parameter onal_buildandal_compile, so an agent can supply it explicitly when the setting isn't discoverable — this would also help in headless/CI scenarios, where there is no VS Code workspace to read the setting from.