Closed narongschmidt closed 4 years ago
@PooyaKharamesh is this the case?
@PooyaKharamesh I can confirm this bug.
You can not publish an app if it initializes an interface with a enum value defined in a referenced application.
procedure TestSquareValues()
var
MathInterface_l: Interface MathInterface; // defined in referenced application
MathEnum_l: Enum MathEnum; // defined in referenced application
MathSquare_l: Codeunit MathSquare;
begin
MathInterface_l := MathSquare_l; // works correctly
MathInterface_l := MathEnum_l::"Square Values"; // can not be published
LibraryAssert_g.AreEqual(4, MathInterface_l.Calculate(2), '');
LibraryAssert_g.AreEqual(36, MathInterface_l.Calculate(2, 3), '');
end;
Version: CH Business Central 16.0 (Platform 16.0.11233.12163 + Application 16.0.11240.12188)
I can confirm the bug too. It breaks my test pipelines: I am unable to publish my test apps if I use interfaces.
I have noticed that publishing from VSCode works but it fails when using the Powershell commands.
@Weichwolf , @narongschmidt Have you create a workspace with proper dependencies (project references) and are you trying to publish from VsCode, or powershell? Since this should be working with project references in a workspace as mentioned above
@kalberes A workspace with project references was created and I publish from VS Code.
I do face the similar issue in Business central 16.0.
Thanks for reporting the issue and providing reproduction steps, it helps a lot. I verified with the code from @Weichwolf repository and the issue has been fixed but please give it a try when the next update comes.
It's still not working in 16.1.12629.12805
Are you able to test this on the preview version of the product by any chance?
@thpeder Why is this closed? I still get this in platform 16.0.12630.12758
I can confirm that it is solved in preview of 16.0 CU2 (Platform 16.0.13347.0). So @thpeder forget my question about why it is closed, it should be closed. :)
Describe the bug It's not possible to publish an app that uses an interface and enum that is defined in another extension.
Publishing results in error code 422 and message:
Unable to cast object of type 'Microsoft.Dynamics.Nav.CodeAnalysis.Symbols.ReferenceEnumTypeSymbol' to type 'Microsoft.Dynamics.Nav.CodeAnalysis.Symbols.SourceEnumTypeSymbol'.
To Reproduce Steps and to reproduce the behavior:
Expected behavior The app is successfully published to the instance.
Screenshots If applicable, add screenshots to help explain your problem.
5. Versions: