microsoft / AL

Home of the Dynamics 365 Business Central AL Language extension for Visual Studio Code. Used to track issues regarding the latest version of the AL compiler and developer tools available in the Visual Studio Code Marketplace or as part of the AL Developer Preview builds for Dynamics 365 Business Central.
MIT License
732 stars 243 forks source link

Latest AL Language Extension generates invalid SymbolReference.json in app package (v14.0.1108692 (pre-release)) #7828

Closed vejbalzer closed 3 days ago

vejbalzer commented 3 weeks ago

Please include the following with each issue:

1. Describe the bug When creating an app package e.g. with the "AL: Package" command, the generated app file contains a SymbolReference.json file with invalid JSON. It seems like the content is doubled, compared to how it should be. For example it looks like this:

{"RuntimeVersion":"9.0","Codeunits":[],"PageExtensions":[{"TargetObject":"Customer List","Variables":[{"TypeDefinition":{"Name":"Integer"},"Name":"myInt"}],"ActionChanges":[{"Anchor":"processing","ChangeKind":1,"Actions":[{"Kind":2,"Properties":[{"Name":"ApplicationArea","Value":"#All"}],"Id":885376841,"Name":"Test"}]}],"ReferenceSourceFileName":"HelloWorld.al","Id":50100,"Name":"CustomerListExt"}],"Reports":[],"XmlPorts":[],"Queries":[],"ControlAddIns":[],"EnumTypes":[],"DotNetPackages":[],"Interfaces":[],"PermissionSets":[],"PermissionSetExtensions":[],"ReportExtensions":[],"InternalsVisibleToModules":[],"AppId":"93ba70c0-3bda-421d-b731-675c3a52b841","Name":"ALProject1","Publisher":"Default publisher","Version":"1.0.0.0"}{"RuntimeVersion":"9.0","Codeunits":[],"PageExtensions":[{"TargetObject":"Customer List","Variables":[{"TypeDefinition":{"Name":"Integer"},"Name":"myInt"}],"ActionChanges":[{"Anchor":"processing","ChangeKind":1,"Actions":[{"Kind":2,"Properties":[{"Name":"ApplicationArea","Value":"#All"}],"Id":885376841,"Name":"Test"}]}],"ReferenceSourceFileName":"HelloWorld.al","Id":50100,"Name":"CustomerListExt"}],"Reports":[],"XmlPorts":[],"Queries":[],"ControlAddIns":[],"EnumTypes":[],"DotNetPackages":[],"Interfaces":[],"PermissionSets":[],"PermissionSetExtensions":[],"ReportExtensions":[],"InternalsVisibleToModules":[],"AppId":"93ba70c0-3bda-421d-b731-675c3a52b841","Name":"ALProject1","Publisher":"Default publisher","Version":"1.0.0.0"}

2. To Reproduce Steps to reproduce the behavior:

  1. Create a new extension with "AL: Go!"
  2. Download symbols with "AL: Download symbols"
  3. Create app file with "AL: Package"

3. Expected behavior SymbolReference.json contains valid JSON

4. Actual behavior SymbolReference.json contains doubled content which leads to invalid JSON

5. Versions:

Final Checklist

Please remember to do the following:

Internal work item: AB#545880

christian-clausen commented 3 weeks ago

We have seen this issue, also, with a quite a few .app files in 25.0.23170.0.

Here is a screendump of the result of trying to reformat SymbolReference.json from artefact downloaded file C:\bcartifacts.cache\sandbox\25.0.23170.0\dk\Extensions\Microsoft_Transactions and Receipts Storage_25.0.23170.0.app.

image

The part in the red square looks like the end of a normal SymbolReference.json file.

Maybe SymbolReference.json was written with File.OpenWrite (which by default does not truncate if the file already exists) at a time when there is a bigger SymbolReference.json from a previous build (unclean workspace)?

pri-kise commented 2 weeks ago

I have the same issue when I was working for the BaseApp with version 25.0.23212.0 The symbol reference of the System Application is wrong: SymbolReference.json

rvanbekkum commented 2 weeks ago

I suspect we also are experiencing issues from this. We get weird error messages like error AL0281: Object member '<EventPublisherName>' is not an event. when having an event subscriber to an event publisher for which nothing has changed. The target procedure is actually an event publisher.

JesperSchulz commented 3 days ago

The fix for this issue has been checked in to the master branch. It will be available in the bcinsider.azurecr.io/bcsandbox-master Docker image starting from platform build number 26.0.23829.0 and VS Code Extension Version 15.0.1128421.

If you don’t have access to these images you need to become part of the Ready2Go program: aka.ms/readytogo

For more details on code branches and docker images please read: https://blogs.msdn.microsoft.com/nav/2018/05/03/al-developer-previews-multiple-releases-and-github/ https://freddysblog.com/2020/06/25/working-with-artifacts/

christian-clausen commented 2 days ago

Will the fix will be available in BC25, VS Code Extension version 14 also?