Closed MODUSCarstenScholling closed 3 months ago
The issue here isn't that ALC is behaving differently from the server, but the version of the dlls backing the DotNet type are different. We've recently changed the definition of NavAppPackageReader::Create
which leads to the difference between what your local ALC run thinks is valid and what the server thinks is valid.
Given that these are internal types, we do not make any guarantees about their interfaces changing and we can and do change them as necessary.
1. Describe the bug ALC and server compiler working differently for DotNet methods with optional arguments. While omitted optional arguments are allowed and not causing any issues in ALC/VSCode, the server raises a runtime error when optional arguments to methods are missing.
2. To Reproduce You need a BC instance allowing target OnPrem.
3. Expected behavior When clicking Actions -> "Not Working", no runtime error should occur. The called method should be identified correctly taking optional arguments into account.
4. Actual behavior When clicking Actions -> "Not Working", the following error occurs:
A call to Microsoft.Dynamics.Nav.CodeAnalysis.Packaging.NavAppPackageReader.Create failed with this message: The type of one or more arguments does not match the method's parameter type.
5. Versions:
6. Information
public static NavAppPackageReader Create(Stream stream, bool leaveOpen = false, string? packagePath = null)
The called .net method contains optional arguments leaveOpen and packagePath. While VSCode/ALC allows to only specify stream, the BC server requires all arguments to be specified to identify the method.