HodorNV / ALOps

ALOps
59 stars 24 forks source link

Compile against NextMajor - Microsoft.Dynamics.Nav.Management.NavAdminLogger error #368

Closed fvet closed 3 years ago

fvet commented 3 years ago

Describe the bug Compiling our code using ALOpsAppCompiler@2 against the NextMajor fails on The type initializer for 'Microsoft.Dynamics.Nav.Management.NavAdminLogger' threw an exception.

We don't depend / reference NavAdminLogger in our code, not sure if it's something ALOPS depends on?

the output Also the complete output is necessary for us to see what is going on. Also use backtics:


2021-05-16T12:28:52.4484582Z ##[section]Starting: Compile applications
2021-05-16T12:28:52.4580532Z ==============================================================================
2021-05-16T12:28:52.4580980Z Task         : ALOps App Compiler
2021-05-16T12:28:52.4581379Z Description  : Compile AL Extension(s) for Business Central
2021-05-16T12:28:52.4581768Z Version      : 2.0.2429
2021-05-16T12:28:52.4582104Z Author       : Hodor
2021-05-16T12:28:52.4582487Z Help         : Compile Business Central extension(s) from AL code.
2021-05-16T12:28:52.4583074Z ==============================================================================
2021-05-16T12:28:53.6209769Z ******************************************************************************
2021-05-16T12:28:53.6216312Z *** ALOps v2 - Preview                                                     ***
2021-05-16T12:28:53.6221050Z ******************************************************************************
2021-05-16T12:28:53.6225716Z *** Importing required ALOps-Functions
2021-05-16T12:28:53.8586135Z *** Task Inputs:
2021-05-16T12:28:53.8622522Z 
2021-05-16T12:28:53.8694394Z name                   value                                                                                           
2021-05-16T12:28:53.8696901Z ----                   -----                                                                                           
2021-05-16T12:28:53.8697925Z artifactversion                                                                                                        
2021-05-16T12:28:53.8700658Z artifacttype           Sandbox                                                                                         
2021-05-16T12:28:53.8702151Z artifactcountry        W1                                                                                              
2021-05-16T12:28:53.8704410Z versionselect          NextMajor                                                                                       
2021-05-16T12:28:53.8705903Z alternativevsixurl                                                                                                     
2021-05-16T12:28:53.8708125Z alsourcepath           C:\DockerInstallation\Agent2\_work\58\s                                                         
2021-05-16T12:28:53.8710542Z ruleset                                                                                                                
2021-05-16T12:28:53.8712030Z appversiontemplate     ?.?.?.*                                                                                         
2021-05-16T12:28:53.8714271Z appfilenametemplate    %APP_PUBLISHER%_%APP_NAME%_%APP_VERSION%_%BC_TYPE%_%BC_VERSION%_%BC_COUNTRY%.app                
2021-05-16T12:28:53.8715580Z alcodeanalyzer                                                                                                         
2021-05-16T12:28:53.8717975Z showmycode             Keep                                                                                            
2021-05-16T12:28:53.8718982Z applicationinsightskey                                                                                                 
2021-05-16T12:28:53.8721774Z alcachepath            C:\DockerInstallation\Agent2\_work\58\s                                                         
2021-05-16T12:28:53.8724445Z publishartifact        False                                                                                           
2021-05-16T12:28:53.8726931Z publishxlif            False                                                                                           
2021-05-16T12:28:53.8729506Z failonwarnings         False                                                                                           
2021-05-16T12:28:53.8732035Z storageaccount                                                                                                         
2021-05-16T12:28:53.8745251Z sastoken               ?sv=2019-02-02&sig=IN9bl0THH1U5idOF612IGG7jQaMAOznBjFlqyUHuysQ%3D&spr=https&st=2021-03-15T00%...
2021-05-16T12:28:53.8747322Z printappmanifest       True                                                                                            
2021-05-16T12:28:53.8747728Z 
2021-05-16T12:28:53.8760529Z 
2021-05-16T12:28:53.8765156Z 
2021-05-16T12:28:53.8867536Z *** For documentation, please visit   : https://www.alops.be/documentation
2021-05-16T12:28:53.8869741Z 
2021-05-16T12:28:54.1666163Z *** ALOps License:
2021-05-16T12:28:54.1680781Z   * Licensed To: Navitrans
2021-05-16T12:28:54.1683517Z 
2021-05-16T12:28:54.2736128Z *** Memory Status: 24.86/31.84 (78.08% Free)
2021-05-16T12:28:54.4065822Z *** Importing required Task-Functions
2021-05-16T12:28:55.6557566Z 
2021-05-16T12:28:55.6731311Z *** Artifact Type   : [Sandbox]
2021-05-16T12:28:55.6737639Z *** Artifact Version: []
2021-05-16T12:28:55.6815127Z *** Artifact Country: [W1]
2021-05-16T12:28:55.6822582Z *** AL Source Path  : [C:\DockerInstallation\Agent2\_work\58\s]
2021-05-16T12:28:55.6829408Z *** AL Cache Path   : [C:\DockerInstallation\Agent2\_work\58\s]
2021-05-16T12:28:55.6831389Z 
2021-05-16T12:28:55.6850800Z 
2021-05-16T12:28:55.7010302Z *** Default Working Folder: C:\DockerInstallation\Agent2\_work\58\s
2021-05-16T12:28:55.7018022Z *** Artifact Folder       : C:\DockerInstallation\Agent2\_work\58\a
2021-05-16T12:28:55.7026309Z *** Agent Tool Folder     : C:\DockerInstallation\Agent2\_work\_tool
2021-05-16T12:28:55.7033664Z *** Agent Temp Folder     : C:\DockerInstallation\Agent2\_work\_temp
2021-05-16T12:28:55.7036384Z 
2021-05-16T12:28:55.7063608Z *** Resolving Path: [C:\DockerInstallation\Agent2\_work\58\s]
2021-05-16T12:28:55.7098219Z *** AL Source Folder      : C:\DockerInstallation\Agent2\_work\58\s
2021-05-16T12:28:55.7107280Z *** Resolving Path: [C:\DockerInstallation\Agent2\_work\58\s]
2021-05-16T12:28:55.7117415Z *** AL Cache Folder       : C:\DockerInstallation\Agent2\_work\58\s
2021-05-16T12:28:55.7119592Z 
2021-05-16T12:28:55.7130985Z *** Check BcContainerHelper
2021-05-16T12:28:55.7870644Z *** Load BcContainerHelper
2021-05-16T12:28:55.9251746Z BcContainerHelper version 2.0.5
2021-05-16T12:28:57.2022364Z 
2021-05-16T12:28:57.2027467Z 
2021-05-16T12:28:57.2072683Z ##[command]"Get-BCArtifactUrl" 
2021-05-16T12:28:57.2073445Z Name                           Value                                                                                   
2021-05-16T12:28:57.2074147Z ----                           -----                                                                                   
2021-05-16T12:28:57.2074740Z sasToken                       ?sv=2019-02-02&sig=IN9bl0THH1U5idOF612IGG7jQaMAOznBjFlqyUHuysQ%3D&spr=https&st=2021-0...
2021-05-16T12:28:57.2075381Z select                         NextMajor                                                                               
2021-05-16T12:28:57.2076300Z type                           Sandbox                                                                                 
2021-05-16T12:28:57.2076945Z country                        W1                                                                                      
2021-05-16T12:28:57.2077246Z 
2021-05-16T12:28:57.2077419Z 
2021-05-16T12:28:57.2078083Z  -sasToken: *** -select: NextMajor -type: Sandbox -country: W1
2021-05-16T12:29:11.5318417Z Downloading application artifact /sandbox/19.0.25515.0/w1
2021-05-16T12:29:11.5415568Z Downloading C:\WINDOWS\TEMP\0ba77a54-4ea6-4f10-8c1f-1d12c97d6436.zip
2021-05-16T12:29:32.3732664Z Unpacking application artifact to tmp folder using Expand-Archive
2021-05-16T12:29:36.3182347Z Downloading platform artifact /sandbox/19.0.25515.0/platform
2021-05-16T12:29:36.3199461Z Downloading C:\WINDOWS\TEMP\c25206d3-12a9-4f3b-a839-917219f9dce1.zip
2021-05-16T12:30:09.7012210Z Unpacking platform artifact to tmp folder using Expand-Archive
2021-05-16T12:31:39.7722075Z Downloading Prerequisite Components
2021-05-16T12:31:39.7798739Z Downloading c:\bcartifacts.cache\sandbox\19.0.25515.0\platform\Prerequisite Components\Open XML SDK 2.5 for Microsoft Office\OpenXMLSDKv25.msi
2021-05-16T12:31:40.0505282Z Downloading c:\bcartifacts.cache\sandbox\19.0.25515.0\platform\Prerequisite Components\IIS URL Rewrite Module\rewrite_2.0_rtw_x64.msi
2021-05-16T12:31:40.3261087Z Downloading c:\bcartifacts.cache\sandbox\19.0.25515.0\platform\Prerequisite Components\DotNetCore\DotNetCore.1.0.4_1.1.1-WindowsHosting.exe
2021-05-16T12:31:44.9906710Z *** Platform: c:\bcartifacts.cache\sandbox\19.0.25515.0\platform
2021-05-16T12:31:44.9926555Z *** Localisation: c:\bcartifacts.cache\sandbox\19.0.25515.0\w1
2021-05-16T12:31:45.0048342Z *** BC Management DLL: C:\bcartifacts.cache\sandbox\19.0.25515.0\platform\LegacyDlls\program files\Microsoft Dynamics NAV\180\RoleTailored Client\Microsoft.Dynamics.Nav.Management.dll
2021-05-16T12:31:45.0280876Z *** BC App Management DLL: C:\bcartifacts.cache\sandbox\19.0.25515.0\platform\LegacyDlls\program files\Microsoft Dynamics NAV\180\RoleTailored Client\Microsoft.Dynamics.Nav.Apps.Management.dll
2021-05-16T12:31:45.0405113Z *** Get [*.app] and [app.json] files recursive from [C:\DockerInstallation\Agent2\_work\58\s]
2021-05-16T12:31:45.5762998Z *** Found [63] files.
2021-05-16T12:31:45.5768612Z *** Extract App detail from [C:\DockerInstallation\Agent2\_work\58\s\Navitrans.Ameta\app\app.json]
2021-05-16T12:31:45.5858977Z *** Extract App detail from [C:\DockerInstallation\Agent2\_work\58\s\Navitrans.API\app\app.json]
2021-05-16T12:31:45.5923472Z *** Extract App detail from [C:\DockerInstallation\Agent2\_work\58\s\Navitrans.bAlert\app\app.json]
2021-05-16T12:31:45.5979463Z *** Extract App detail from [C:\DockerInstallation\Agent2\_work\58\s\Navitrans.Base\app\.alpackages\Navitrans_Navitrans 365 Base Application_17.3.0.11749_onprem_17.2_w1.app]
2021-05-16T12:31:45.6719791Z ##[error]The type initializer for 'Microsoft.Dynamics.Nav.Management.NavAdminLogger' threw an exception.
2021-05-16T12:31:45.6959926Z ##[section]Finishing: Compile applications

FYI : C:\DockerInstallation\Agent2_work\58\s\Navitrans.Base\app.alpackages\Navitrans_Navitrans 365 Base Application_17.3.0.11749_onprem_17.2_w1.app is our previous app package.

DanielGoehler commented 3 years ago

We have the same Problem.

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

name                   value                                                                                           
----                   -----                                                                                           
artifactversion                                                                                                        
artifacttype           Sandbox                                                                                         
artifactcountry        de                                                                                              
versionselect          NextMajor                                                                                       
alternativevsixurl                                                                                                     
alsourcepath           C:\agent1\_work\92\s                                                                            
ruleset                                                                                                                
appversiontemplate     17.3.0.*                                                                                        
appfilenametemplate    %APP_PUBLISHER%_%APP_NAME%_%APP_VERSION%_%BC_TYPE%_%BC_VERSION%_%BC_COUNTRY%.app                
alcodeanalyzer         AppSourceCop,CodeCop,PerTenantExtensionCop,UICop                                                
showmycode             Keep                                                                                            
applicationinsightskey                                                                                                 
alcachepath            C:\agent1\_work\92\s                                                                            
publishartifact        False                                                                                           
publishxlif            False                                                                                           
failonwarnings         False                                                                                           
storageaccount                                                                                                         
sastoken               ...
printappmanifest       True                                                                                            

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

*** Importing required Task-Functions

*** Artifact Type   : [Sandbox]
*** Artifact Version: []
*** Artifact Country: [de]
*** AL Source Path  : [C:\agent1\_work\92\s]
*** AL Cache Path   : [C:\agent1\_work\92\s]

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

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

*** Check BcContainerHelper
*** Load BcContainerHelper
BcContainerHelper version 2.0.11

##[command]"Get-BCArtifactUrl" 
Name                           Value                                                                                   
----                           -----                                                                                   
sasToken                       ?sv=2019-02-02&sig=IN9bl0THH1U5idOF612IGG7jQaMAOznBjFlqyUHuysQ%3D&spr=https&st=2021-0...
select                         NextMajor                                                                               
type                           Sandbox                                                                                 
country                        de                                                                                      

 -sasToken: *** -select: NextMajor -type: Sandbox -country: de
Downloading application artifact /sandbox/19.0.25519.0/de
Downloading C:\Users\script-service\AppData\Local\Temp\de6dc490-ec3b-43a6-a901-096836184ef5.zip
Unpacking application artifact to tmp folder using 7zip
Downloading platform artifact /sandbox/19.0.25519.0/platform
Downloading C:\Users\script-service\AppData\Local\Temp\78a13596-e520-4ba3-ba56-20c574d118ae.zip
Unpacking platform artifact to tmp folder using 7zip
Downloading Prerequisite Components
Downloading c:\bcartifacts.cache\sandbox\19.0.25519.0\platform\Prerequisite Components\Open XML SDK 2.5 for Microsoft Office\OpenXMLSDKv25.msi
Downloading c:\bcartifacts.cache\sandbox\19.0.25519.0\platform\Prerequisite Components\IIS URL Rewrite Module\rewrite_2.0_rtw_x64.msi
Downloading c:\bcartifacts.cache\sandbox\19.0.25519.0\platform\Prerequisite Components\DotNetCore\DotNetCore.1.0.4_1.1.1-WindowsHosting.exe
*** Platform: c:\bcartifacts.cache\sandbox\19.0.25519.0\platform
*** Localisation: c:\bcartifacts.cache\sandbox\19.0.25519.0\de
*** BC Management DLL: C:\bcartifacts.cache\sandbox\19.0.25519.0\platform\LegacyDlls\program files\Microsoft Dynamics NAV\180\RoleTailored Client\Microsoft.Dynamics.Nav.Management.dll
*** BC App Management DLL: C:\bcartifacts.cache\sandbox\19.0.25519.0\platform\LegacyDlls\program files\Microsoft Dynamics NAV\180\RoleTailored Client\Microsoft.Dynamics.Nav.Apps.Management.dll
*** Get [*.app] and [app.json] files recursive from [C:\agent1\_work\92\s]
*** Found [7] files.
*** Extract App detail from [C:\agent1\_work\92\s\MainApp\.dependencies\CKL Software GmbH_Kostenrechnung 365  Cost Accounting 365_3.4.1.0.app]
##[error]Der Typeninitialisierer für "Microsoft.Dynamics.Nav.Management.NavAdminLogger" hat eine Ausnahme verursacht.
##[section]Finishing: ALOpsAppCompiler
waldo1001 commented 3 years ago

Hi, I don't get this. Is there a special repro/yaml you can share?

DanielGoehler commented 3 years ago

Sure. Just upload this project to Azure DevOps. You find the pipeline in .azuredevops\NextMajor.yml

NavAdminLogger Example.zip

I get this error:

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

name                   value                                                                                           
----                   -----                                                                                           
artifactversion                                                                                                        
artifacttype           Sandbox                                                                                         
artifactcountry        de                                                                                              
versionselect          NextMajor                                                                                       
alternativevsixurl                                                                                                     
alsourcepath           C:\agent1\_work\491\s                                                                           
ruleset                                                                                                                
appversiontemplate     ?.?.0.*                                                                                         
appfilenametemplate    %APP_PUBLISHER%_%APP_NAME%_%APP_VERSION%_%BC_TYPE%_%BC_VERSION%_%BC_COUNTRY%.app                
alcodeanalyzer         AppSourceCop,CodeCop,PerTenantExtensionCop,UICop                                                
showmycode             Keep                                                                                            
applicationinsightskey                                                                                                 
alcachepath            C:\agent1\_work\491\s                                                                           
publishartifact        False                                                                                           
publishxlif            False                                                                                           
failonwarnings         False                                                                                           
storageaccount                                                                                                         
sastoken               ...
printappmanifest       True                                                                                            
outputalclogs          True                                                                                            
additionalprobingpaths                                                                                                 

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

*** Importing required Task-Functions

*** Artifact Type   : [Sandbox]
*** Artifact Version: []
*** Artifact Country: [de]
*** AL Source Path  : [C:\agent1\_work\491\s]
*** AL Cache Path   : [C:\agent1\_work\491\s]

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

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

*** Check BcContainerHelper
*** Load BcContainerHelper
BcContainerHelper version 2.0.11

##[command]"Get-BCArtifactUrl" 
Name                           Value                                                                                   
----                           -----                                                                                   
sasToken                       ...
select                         NextMajor                                                                               
type                           Sandbox                                                                                 
country                        de                                                                                      

 -sasToken: *** -select: NextMajor -type: Sandbox -country: de
*** Platform: c:\bcartifacts.cache\sandbox\19.0.25759.0\platform
*** Localisation: c:\bcartifacts.cache\sandbox\19.0.25759.0\de
*** BC Management DLL: C:\bcartifacts.cache\sandbox\19.0.25759.0\platform\LegacyDlls\program files\Microsoft Dynamics NAV\180\RoleTailored Client\Microsoft.Dynamics.Nav.Management.dll
*** BC App Management DLL: C:\bcartifacts.cache\sandbox\19.0.25759.0\platform\LegacyDlls\program files\Microsoft Dynamics NAV\180\RoleTailored Client\Microsoft.Dynamics.Nav.Apps.Management.dll
*** Get [*.app] and [app.json] files recursive from [C:\agent1\_work\491\s]
*** Found [2] files.
*** Extract App detail from [C:\agent1\_work\491\s\MainApp\.dependencies\Default publisher_ALProject3_1.0.0.0.app]
##[error]Der Typeninitialisierer für "Microsoft.Dynamics.Nav.Management.NavAdminLogger" hat eine Ausnahme verursacht.
##[section]Finishing: ALOpsAppCompiler
waldo1001 commented 3 years ago

We have a repro, but it's weird. we only do a "Get-navappinfo" on the app in the .dependencies-folder, so I assume it's a bug at Microsoft.

I'm going to verify this, and log an issue if so.. .

waldo1001 commented 3 years ago

We found the issue - it's a bug in the Artifacts 🙄. So frustrating...

waldo1001 commented 3 years ago

We'll hotfix this today.. (building as we speak).

waldo1001 commented 3 years ago

When online - it has version v1.442.2488

We are now taking alternative binaries as the ones in the "LegacyDll"-folder (from the artifacts) seem to be broken...

AdminHodor commented 3 years ago

Dear @fvet ,

Please check our latest release v1.443.2509 which addresses this issue.

Kind regards