AL Compile Issue

BennyVLBennyVL Member Posts: 10
I have the following Test-Codeunit. This small test is just for testing my unit-testing-task in Azure Devops.

g6ar15vyfym8.png

If I publish/package my project, no issues occur and all my apps are deployed (Main App + Test App).
Used compiler on my machine: vscode\extensions\ms-dynamics-smb.al-5.0.312966\bin\alc.exe

If I run my Azure Devops tasks I get an error on the compilation part of my Test App
C:\Run\KTN\Source\test\src\TestAttachment.Codeunit.al(18,43): error AL0133: Argument 1: cannot convert from 'Record Attachment' to 'var __MissingTypeSymbol__'
Used compiler on the buildserver: C:\Run\KTN\ALCompiler\al-5.0.312966\extension\bin\win32\alc.exe
Used Docker Image: onprem:16.3.14085.14238-w1-ltsc2019

The function in the codeunit Library-Marketing (Codeunit 131900) contains the correct record-type Attachment.
Business Central Version : onprem:16.3.14085.14238

8lz3uo8bx58x.png

Anybody who can help me out with this?

Best Answer

  • BennyVLBennyVL Member Posts: 10
    Accepted Answer
    Found the issue...
    On my local copy of the repo the .alpackages was already there , on the buildserver not.
    It's build upon compilation based on the app.json.

    au733abqxbcf.png

    "application" was missing in the app.json, now all is fine.

Answers

  • kylehardinkylehardin Member Posts: 257
    Dees your test app app.json have a dependency for the main app defined?
    Kyle Hardin - ArcherPoint
  • BennyVLBennyVL Member Posts: 10
    Yes It does, otherwise it would also not work if I press F5 in VSCode.
  • kylehardinkylehardin Member Posts: 257
    I have a very similar setup, though I'm still on 16.2. I wonder if there is a difference in the version of the test kit installed in docker versus what devops is doing.

    My docker script does this, which doesn't even have an option for which library you get, so it must be pulling that from the docker container itself. Don't see how that could get you a 16.3 container with 16.1 (or whatever version) test libraries.

    Import-TestToolkitToBCContainer `
    -containerName $containerName `
    -includetestlibrariesonly `
    -doNotUseRuntimePackages

    During your devops build, how are you loading the test libraries? I have a combination of the YAML itself (which doesn't specify a test library version), and a set of powershell scripts that build a docker container and basically use that same docker command as above. It never has an opportunity to decide on a version of the test libraries.

    ## TEST ##
    - powershell: |
    $(Agent.BuildDirectory)\apdockerscripts\Import-TestToolkitToNavContainer.ps1
    -includeTestLibrariesOnly
    displayName: 'Install TestToolkit'

    Anyway - it sounds like somehow you have the wrong version of the test libraries in devops. But that is just a guess. There could also be something wrong with the symbols that are getting downloaded in the middle of the devops build. Those are the only two things I can think of that might cause the Library-Marketing.CreateAttachment procedure to be expecting 'var __MissingTypeSymbol__'
    Kyle Hardin - ArcherPoint
  • Raj120p1Raj120p1 Member Posts: 1
    Yes It does, otherwise it would also not work
  • BennyVLBennyVL Member Posts: 10
    Installed extension before compiling the test app

    qe25w9oqcnm7.png

    As You can see, all the packages are installed, even the compiled "Test Project"

    Downloaded packages when compiling the Test-App, they come from the docker-container.

    j2nypmdql8kv.png

    As you can see, all the packages are downloaded. The Attachment-record is part of the Base Application.

    Now, things are getting more weird... I already told that I could compile both the main app & test app in a local container by pressing F5 in VS Code. If I Publish & Install that compiles "Test Project" Test.App, I don't receive a problem that the attachment-record can't be converted...


  • BennyVLBennyVL Member Posts: 10
    Accepted Answer
    Found the issue...
    On my local copy of the repo the .alpackages was already there , on the buildserver not.
    It's build upon compilation based on the app.json.

    au733abqxbcf.png

    "application" was missing in the app.json, now all is fine.
Sign In or Register to comment.