AL 18.0.2732683 regression: System.Drawing types cannot be resolved from assembly probing paths
Nobody has claimed this yet.
- Dominant language
- PowerShell
- Stars
- 881
- Forks
- 285
- Avg merge
- 3d 36m
- Merged PRs (30d)
- 1
Description
1. Describe the bug
After upgrading the AL Language extension from version 17.x to 18.0.2732683, types from the System.Drawing .NET assembly can no longer be resolved.
The exact same AL project and configuration compile successfully with AL Language 17.x.
The issue has been reproduced on multiple Windows developer machines. Business Central is not installed locally on these developer machines.
Downgrading only the AL Language extension from 18.0.2732683 to 17.x immediately fixes the issue.
Other .NET types, such as System.IO.Directory, are still resolved correctly with AL Language 18.0.2732683.
2. To Reproduce
- Configure the following assembly probing path in
settings.json:
"al.assemblyProbingPaths": [
"C:\\Windows\\assembly"
]
- Declare types from the
System.Drawingassembly:
dotnet
{
assembly("System.Drawing")
{
type("System.Drawing.Bitmap"; "System.Drawing.Bitmap") { }
type("System.Drawing.Imaging.ImageFormat"; "System.Drawing.Imaging.ImageFormat") { }
}
}
-
Compile the project using AL Language 18.0.2732683.
-
Downgrade the AL Language extension to 17.x and compile the exact same project again.
With 17.x, the types are resolved successfully.
3. Expected behavior
System.Drawing.Bitmap and System.Drawing.Imaging.ImageFormat should be resolved from the System.Drawing assembly, as they were with AL Language 17.x.
Upgrading the AL Language extension should not cause previously resolvable .NET types to become unavailable when using the same assembly and assemblyProbingPaths configuration.
4. Actual behavior
With AL Language 18.0.2732683, the compiler finds the System.Drawing assembly but fails to resolve the types contained in it:
The type 'System.Drawing.Bitmap' could not be found in assembly 'System.Drawing'
The type 'System.Drawing.Imaging.ImageFormat' could not be found in assembly 'System.Drawing'
Downgrading the AL Language extension to 17.x resolves the issue immediately, without changing the AL code, assemblyProbingPaths, or Windows configuration.
The same behavior has been reproduced on multiple developer PCs.
5. Versions:
-
AL Language: 18.0.2732683 (issue occurs); 17.x (works)
-
Visual Studio Code: 1.136.1
-
Business Central: BC23 On-Premises
-
Operating System:
- Windows
- Linux
- MacOS
Final Checklist
-
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the settings.json assemblyProbingPaths configuration and the minimal AL dotnet declaration for System.Drawing.Bitmap and ImageFormat. Reproduce the comparison between AL Language 18.0.2732683 and 17.x; done means both types resolve and the project compiles with the current extension without changing the configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- vscode
- Domain
- compilers, devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100