AL Compile Issue

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

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

Anybody who can help me out with this?

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

Anybody who can help me out with this?
0
Best 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.
"application" was missing in the app.json, now all is fine.1
Answers
-
Dees your test app app.json have a dependency for the main app defined?Kyle Hardin - ArcherPoint0
-
Yes It does, otherwise it would also not work if I press F5 in VSCode.0
-
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 - ArcherPoint0 -
0
-
Installed extension before compiling the test app
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.
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...
0 -
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.
"application" was missing in the app.json, now all is fine.1 -
Thank you!! It was the "application" that was missing for me as well.
I got the problem when I tried to quick upgrade my apps from BC 17 & 19 to 21. Think I spent 4 hours on this in total divided in three turns until I figured that it was this that solved it.Hello IT, have you tried to turn it off and on?
Have you checked the cables?
Have you released the filters?
http://www.navfreak.com0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions