HodorNV / ALOps

ALOps
59 stars 24 forks source link

ALOpsAppCompiler@2 with BC14: error AL1023: The package file \MainApp\.ALOPSCache\Microsoft.Dynamics.Nav.Client.application is not valid. #249

Closed DanielGoehler closed 3 years ago

DanielGoehler commented 3 years ago

Describe the bug I know ALOpsAppCompiler Version 2 is in preview. Business Central 16/17 works fine, but I don't get this work with Business Central 14. Any ideas?

the used yaml

name: $(Build.BuildId)

variables:
- group: 'ALOps Settings'

pool:
  name: BusinessCentralBuildAgents

trigger:
- BC14-master

steps:
- checkout: self
  clean: true

- task: ALOpsAppCompiler@2
  inputs:
    artifactversion: '14.10'
    artifactcountry: 'de'
    appversiontemplate: '1.0.*.0'
    alcodeanalyzer: 'AppSourceCop,CodeCop,PerTenantExtensionCop,UICop'

the output

##[section]Starting: ALOpsAppCompiler
==============================================================================
Task         : ALOps App Compiler
Description  : Compile AL Extension(s) for Business Central
Version      : 2.0.1904
Author       : Hodor
Help         : Compile Business Central extension(s) from AL code.
==============================================================================
******************************************************************************
*** ALOps v2 - Preview                                                     ***
******************************************************************************
*** Importing required ALOps-Functions
*** Task Inputs:

name               defaultValue                      required value                                           
----               ------------                      -------- -----                                           
artifactversion                                         False 14.10                                           
artifacttype       OnPrem                               False OnPrem                                          
artifactcountry                                         False de                                              
versionselect      Latest                               False Latest                                          
alsourcepath       $(System.DefaultWorkingDirectory)    False C:\agent1\_work\20\s                            
appversiontemplate 1.0.*.0                               True 1.0.*.0                                         
alcodeanalyzer                                          False AppSourceCop,CodeCop,PerTenantExtensionCop,UICop
alcachepath        $(System.DefaultWorkingDirectory)    False C:\agent1\_work\20\s                            
publishartifact    True                                 False True                                            
failonwarnings     False                                False False                                           
storageaccount                                          False                                                 
sastoken                                                False                                                 

*** For documentation, please visit   : https://www.alops.be/documentation

*** Importing required Task-Functions

*** Artifact Type   : [OnPrem]
*** Artifact Version: [14.10]
*** Artifact Country: [de]
*** AL Source Path  : [C:\agent1\_work\20\s]
*** AL Cache Path   : [C:\agent1\_work\20\s]

*** Default Working Folder: C:\agent1\_work\20\s
*** Artifact Folder       : C:\agent1\_work\20\a
*** Agent Tool Folder     : C:\agent1\_work\_tool
*** Agent Temp Folder     : C:\agent1\_work\_temp

*** Resolving Path: [C:\agent1\_work\20\s]
*** AL Source Folder      : C:\agent1\_work\20\s
*** Resolving Path: [C:\agent1\_work\20\s]
*** AL Cache Folder       : C:\agent1\_work\20\s

*** Check BcContainerHelper
*** Load BcContainerHelper

##[command]"Get-BCArtifactUrl" 
Name                           Value                                                                                   
----                           -----                                                                                   
select                         Latest                                                                                  
version                        14.10                                                                                   
type                           OnPrem                                                                                  
country                        de                                                                                      

 -select: Latest -version: 14.10 -type: OnPrem -country: de
*** Platform: c:\bcartifacts.cache\onprem\14.10.40471.0\platform
*** Localisation: c:\bcartifacts.cache\onprem\14.10.40471.0\de
*** BC Management DLL: C:\bcartifacts.cache\onprem\14.10.40471.0\platform\RoleTailoredClient\program files\Microsoft Dynamics NAV\140\RoleTailored Client\Microsoft.Dynamics.Nav.Management.dll
*** BC App Management DLL: C:\bcartifacts.cache\onprem\14.10.40471.0\platform\RoleTailoredClient\program files\Microsoft Dynamics NAV\140\RoleTailored Client\Microsoft.Dynamics.Nav.Apps.Management.dll
*** Get [*.app] and [app.json] files recursive from [C:\agent1\_work\20\s]
*** Found [1] file.
*** Extract App detail from [C:\agent1\_work\20\s\MainApp\app.json]
*** Starting Batch compile of Apps:
  * C:\agent1\_work\20\s\MainApp
*** Start Compiling: [C:\agent1\_work\20\s\MainApp]
*** Get App Information
*** Loading Json Object: [C:\agent1\_work\20\s\MainApp\app.json]
  * Id         : d3a95b4a-8b77-46e6-82a6-81d4685435b3
  * Publisher  : My Company
  * Name       : My App
  * Description: My App
*** Setting Managed App Version [C:\agent1\_work\20\s\MainApp\app.json] =>  1.0.2625.0
*** VSCode Settings: [C:\agent1\_work\20\s\MainApp\.vscode\settings.json]
*** VSCode-Settings json found.
*** Loading Json Object: [C:\agent1\_work\20\s\MainApp\.vscode\settings.json]
*** Using Ruleset: [C:\agent1\_work\20\s\MainApp\.vscode\ruleset.json]
##[command]"Get-BCArtifactUrl" 
Name                           Value                                                                                   
----                           -----                                                                                   
select                         Latest                                                                                  
version                        14.10                                                                                   
type                           OnPrem                                                                                  
country                        de                                                                                      

*** Platform: c:\bcartifacts.cache\onprem\14.10.40471.0\platform
*** Localisation: c:\bcartifacts.cache\onprem\14.10.40471.0\de
*** Get Platform Apps [11]
*** Get Localised Apps [9]
*** Loaded [20] Platform Apps
*** Get Build Apps [0]
*** AL Cache: [C:\agent1\_work\20\s]
*** Loaded [0] AL Apps
*** VSIX Path: C:\bcartifacts.cache\onprem\14.10.40471.0\platform\ModernDev\program files\Microsoft Dynamics NAV\140\AL Development Environment\ALLanguage.vsix
  * Extracting VSIX to temporary path [c:\bcartifacts.cache\onprem\14.10.40471.0\VSIX-Temp]
  * Rename temporary VSIX Path [c:\bcartifacts.cache\onprem\14.10.40471.0\VSIX-Temp] => [c:\bcartifacts.cache\onprem\14.10.40471.0\VSIX]
*** ALC Path: C:\bcartifacts.cache\onprem\14.10.40471.0\VSIX\extension\bin\alc.exe
*** AL Language Version: 3.0.193882
*** App To Build: [C:\agent1\_work\20\a\My Company_My App_1.0.2625.0_OnPrem_14.10_de.app]
*** Checking for Assemblies in App
*** Add Windows Assembly Path [C:\Windows\assembly]
*** Adding Add-In assemblies [C:\bcartifacts.cache\onprem\14.10.40471.0\platform\RoleTailoredClient\program files\Microsoft Dynamics NAV\140\RoleTailored Client\Add-ins]
*** Adding Add-In assemblies [C:\bcartifacts.cache\onprem\14.10.40471.0\platform\ServiceTier\program files\Microsoft Dynamics NAV\140\Service\Add-ins]
*** Searching CodeCop: AppSourceCop
*** Codecop found: C:\bcartifacts.cache\onprem\14.10.40471.0\VSIX\extension\bin\Analyzers\Microsoft.Dynamics.Nav.AppSourceCop.dll
*** Searching CodeCop: CodeCop
*** Codecop found: C:\bcartifacts.cache\onprem\14.10.40471.0\VSIX\extension\bin\Analyzers\Microsoft.Dynamics.Nav.CodeCop.dll
*** Searching CodeCop: PerTenantExtensionCop
*** Codecop found: C:\bcartifacts.cache\onprem\14.10.40471.0\VSIX\extension\bin\Analyzers\Microsoft.Dynamics.Nav.PerTenantExtensionCop.dll
*** Searching CodeCop: UICop
*** Codecop found: C:\bcartifacts.cache\onprem\14.10.40471.0\VSIX\extension\bin\Analyzers\Microsoft.Dynamics.Nav.UICop.dll
*** Copy BC Artifact dependencies
*** Copy Project Artifact dependencies
*** Copy Build Artifacts
*** Start ALC.EXE / Compile AL Extension
##[command]& alc.exe /packagecachepath:"C:\agent1\_work\20\s\MainApp\.ALOPSCache" /project:"C:\agent1\_work\20\s\MainApp" /out:"C:\agent1\_work\20\a\My Company_My App_1.0.2625.0_OnPrem_14.10_de.app" /fullpaths /assemblyprobingpaths:C:\Windows\assembly,C:\bcartifacts.cache\onprem\14.10.40471.0\platform\RoleTailoredClient\program files\Microsoft Dynamics NAV\140\RoleTailored Client\Add-ins,C:\bcartifacts.cache\onprem\14.10.40471.0\platform\ServiceTier\program files\Microsoft Dynamics NAV\140\Service\Add-ins /analyzer:"C:\bcartifacts.cache\onprem\14.10.40471.0\VSIX\extension\bin\Analyzers\Microsoft.Dynamics.Nav.AppSourceCop.dll","C:\bcartifacts.cache\onprem\14.10.40471.0\VSIX\extension\bin\Analyzers\Microsoft.Dynamics.Nav.CodeCop.dll","C:\bcartifacts.cache\onprem\14.10.40471.0\VSIX\extension\bin\Analyzers\Microsoft.Dynamics.Nav.PerTenantExtensionCop.dll","C:\bcartifacts.cache\onprem\14.10.40471.0\VSIX\extension\bin\Analyzers\Microsoft.Dynamics.Nav.UICop.dll" /ruleset:"C:\agent1\_work\20\s\MainApp\.vscode\ruleset.json"
*** AL Compiler Exit Code: 1
*** Set Pipeline variable $(ALOPS_COMPILE_ARTIFACT) = 'C:\agent1\_work\20\a\My Company_My App_1.0.2625.0_OnPrem_14.10_de.app'
*** Start processing compile results.
##[error]error AL1023: The package file \MainApp\.ALOPSCache\Microsoft.Dynamics.Nav.Client.application is not valid.
##[error]error AL1022: A package with publisher 'Microsoft', name 'Application', and a version compatible with '14.0.0.0' could not be found in the package cache folder '\MainApp\.ALOPSCache'
##[error]error AL1023: The package file \MainApp\.ALOPSCache\Microsoft.Dynamics.Nav.Client.application is not valid.
ModuleType Version Name              ExportedCommands                                                                  
---------- ------- ----              ----------------                                                                  
Script     1.0.12  BcContainerHelper {Add-FontsToBcContainer, Add-GitToAlProjectFolder, Backup-BcContainerDatabases,...

AlertCode Line RelativePath File AlertSource AlertMessage                                                              
--------- ---- ------------ ---- ----------- ------------                                                              
AL1023                           AL Compiler The package file C:\agent1\_work\20\s\MainApp\.ALOPSCache\Microsoft.Dyn...
AL1022                           AL Compiler A package with publisher 'Microsoft', name 'Application', and a version...
AL1023                           AL Compiler The package file C:\agent1\_work\20\s\MainApp\.ALOPSCache\Microsoft.Dyn...

*** Set Pipeline variable $(ALOPS_COMPILE_LOG) = 'C:\agent1\_work\20\s\My Company_My App_1.0.2625.0_OnPrem_14.10_de.log'
*** App not Created: [C:\agent1\_work\20\a\My Company_My App_1.0.2625.0_OnPrem_14.10_de.app]
*** BC Artifact [C:\agent1\_work\20\a\My Company_My App_1.0.2625.0_OnPrem_14.10_de.app] not produced.
##[section]Async Command Start: Add Build Tag
Build '2625' has following tags now: AL.Analyzer.PerTenantExtensionCop, AL.Analyzer.AppSourceCop
##[section]Async Command End: Add Build Tag
##[section]Async Command Start: Add Build Tag
Build '2625' has following tags now: AL.Analyzer.UICop, AL.Analyzer.PerTenantExtensionCop, AL.Analyzer.AppSourceCop, AL.Analyzer.CodeCop
##[section]Async Command End: Add Build Tag
##[section]Async Command Start: Add Build Tag
Build '2625' has following tags now: AL.Analyzer.PerTenantExtensionCop
##[section]Async Command End: Add Build Tag
##[section]Async Command Start: Add Build Tag
Build '2625' has following tags now: AL.Analyzer.UICop, AL.Analyzer.PerTenantExtensionCop, AL.Analyzer.AppSourceCop
##[section]Async Command End: Add Build Tag
##[section]Finishing: ALOpsAppCompiler
waldo1001 commented 3 years ago

The CompilerV2 is dependent from what Microsoft makes available as Apps in the Artifacts. From the moment, all is AL, the BaseApp, System,.. is an app as well. This is not the case for v14. V14, we needed to download symbols from the NST. This NST is only available when you set it up (with Docker).

So in other words .. we can't "just" generated symbols from a database backup, we need to set up docker for that. Hence - CompilerV1.

We will investigate some more, but I don't see it possible to support v14 with CompilerV2 at this point.

This is V17: image That folder does not exist in V14: image In fact - these are all apps that come with V14 - not BaseApp: image

DanielGoehler commented 3 years ago

Yeah, right. System.app with the Symbols is on the DVD, but no the Application. So BC14 and below will not work with ALOpsAppCompiler@2.

waldo1001 commented 3 years ago

Small remark - you can handle the artifacts yourself and make them available some way (downloading from azure blob or something) .. that way, the compiler will find them, and compile will work. But it's something you'll have to manage yourself..