HodorNV / ALOps

ALOps
58 stars 24 forks source link

ALOpsAppCompiler@2 with BC 14: Newtonsoft.Json, Version=9.0.0.0 is missing #291

Closed DanielGoehler closed 3 years ago

DanielGoehler commented 3 years ago

Describe the bug Like suggested in #249 I provided also the BaseApp. Now I get the error message that Newtonsoft.Json, Version=9.0.0.0 is missing.

the used yaml

name: $(Build.BuildId)

variables:
- name: 'AppVersion'
  value: '14.0.*.0'
- group: 'ALOps Settings'

pool:
  name: BusinessCentralBuildAgents

trigger:
- master

steps:
- checkout: self
  clean: true

- task: ALOpsAppCompiler@2
  inputs:
    artifactversion: '14.17'
    artifactcountry: 'de'
    alsourcepath: '$(System.DefaultWorkingDirectory)/MainApp'
    appversiontemplate: '$(AppVersion)'    

the output

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

name                value                                                                           
----                -----                                                                           
artifactversion     14.17                                                                           
artifacttype        OnPrem                                                                          
artifactcountry     de                                                                              
versionselect       Latest                                                                          
alsourcepath        C:\agent1\_work\152\s/MainApp                                                   
ruleset                                                                                             
appversiontemplate  14.0.*.0                                                                        
appfilenametemplate %APP_PUBLISHER%_%APP_NAME%_%APP_VERSION%_%BC_TYPE%_%BC_VERSION%_%BC_COUNTRY%.app
alcodeanalyzer                                                                                      
alcachepath         C:\agent1\_work\152\s                                                           
publishartifact     True                                                                            
publishxlif         False                                                                           
failonwarnings      False                                                                           
storageaccount                                                                                      
sastoken                                                                                            

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

*** Importing required Task-Functions

*** Artifact Type   : [OnPrem]
*** Artifact Version: [14.17]
*** Artifact Country: [de]
*** AL Source Path  : [C:\agent1\_work\152\s/MainApp]
*** AL Cache Path   : [C:\agent1\_work\152\s]

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

*** Resolving Path: [C:\agent1\_work\152\s/MainApp]
*** Resolved Path : [C:\agent1\_work\152\s\MainApp]
*** AL Source Folder      : C:\agent1\_work\152\s\MainApp
*** Resolving Path: [C:\agent1\_work\152\s]
*** AL Cache Folder       : C:\agent1\_work\152\s

*** Check BcContainerHelper
*** Load BcContainerHelper
BcContainerHelper version 1.0.14-dev

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

 -select: Latest -version: 14.17 -type: OnPrem -country: de
*** Platform: c:\bcartifacts.cache\onprem\14.17.44663.0\platform
*** Localisation: c:\bcartifacts.cache\onprem\14.17.44663.0\de
*** BC Management DLL: C:\bcartifacts.cache\onprem\14.17.44663.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.17.44663.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\152\s\MainApp]
*** Found [2] files.
*** Extract App detail from [C:\agent1\_work\152\s\MainApp\.dependencies\Microsoft_Application_14.0.29537.0.app]
*** Extract App detail from [C:\agent1\_work\152\s\MainApp\app.json]
*** Starting Batch compile of Apps:
  * C:\agent1\_work\152\s\MainApp
*** Start Compiling: [C:\agent1\_work\152\s\MainApp]
*** Get App Information
*** Loading Json Object: [C:\agent1\_work\152\s\MainApp\app.json]
  * Id         : f9f406ba-a7c2-43fb-9534-abe714aafe6d
  * Publisher  : My Company
  * Name       : My App
*** Setting Managed App Version [C:\agent1\_work\152\s\MainApp\app.json] =>  14.0.4013.0
*** VSCode Settings: [C:\agent1\_work\152\s\MainApp\.vscode\settings.json]
*** VSCode-Settings json found.
*** Loading Json Object: [C:\agent1\_work\152\s\MainApp\.vscode\settings.json]
*** Get CodeAnalyzers from VSCode Settings
*** Set CodeAnalyzers: CodeCop,UICop,PerTenantExtensionCop
*** Using Ruleset: [C:\agent1\_work\152\s\MainApp\.vscode\ruleset.json]
##[command]"Get-BCArtifactUrl" 
Name                           Value                                                                                   
----                           -----                                                                                   
select                         Latest                                                                                  
version                        14.17                                                                                   
type                           OnPrem                                                                                  
country                        de                                                                                      

*** Platform: c:\bcartifacts.cache\onprem\14.17.44663.0\platform
*** Localisation: c:\bcartifacts.cache\onprem\14.17.44663.0\de
*** VSIX Path: C:\bcartifacts.cache\onprem\14.17.44663.0\platform\ModernDev\program files\Microsoft Dynamics NAV\140\AL Development Environment\ALLanguage.vsix
*** ALC Path: C:\bcartifacts.cache\onprem\14.17.44663.0\VSIX\extension\bin\alc.exe
*** Nav.CodeAnalysis Path: C:\bcartifacts.cache\onprem\14.17.44663.0\VSIX\extension\bin\Microsoft.Dynamics.Nav.CodeAnalysis.dll
##[error]Die Datei oder Assembly "Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed" oder eine Abhängigkeit davon wurde nicht gefunden. Das System kann die angegebene Datei nicht finden.
##[section]Finishing: ALOpsAppCompiler
waldo1001 commented 3 years ago

Hi @DanielGoehler ,

Sorry for the wait.

I'd like to repro this. Is it true that this happens when using a customized base app against CompilerV2 - v14.17 Onprem (assuming it's still a problem).

DanielGoehler commented 3 years ago

Hi @waldo1001,

in this case, no. (But I would need and will test this also.)

I used the Base App for 14.0 OnPrem (DE). Docker Artifacts URL is https://bcartifacts.azureedge.net/onprem/14.0.29537.0/de

DanielGoehler commented 3 years ago

@waldo1001 The Base App for 14.0 OnPrem (DE) to download.

waldo1001 commented 3 years ago

I think we can get this newtonsoftjson-issue fixed .. but I need to be able to repro. And I'm still not able to.

Can you share your repo?
or an example?
Screenshots with the folder structure?

anything that can help.. . I was able to download the symbols for the DE-baseapp .. but that's only symbols, no code (obviously, because it's v14). How do you use this in your pipeline/repo? How does your root look like, and how does the MainApp folder look like?

Sorry for this, but I need better info.

DanielGoehler commented 3 years ago

Hi @waldo1001,

attached you find a example project which cause this problem. TestProject.zip

DanielGoehler commented 3 years ago

Current output

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

name                value                                                                           
----                -----                                                                           
artifactversion     14.17                                                                           
artifacttype        OnPrem                                                                          
artifactcountry     de                                                                              
versionselect       Latest                                                                          
alsourcepath        C:\agent2\_work\169\s/MainApp                                                   
ruleset                                                                                             
appversiontemplate  14.0.*.0                                                                        
appfilenametemplate %APP_PUBLISHER%_%APP_NAME%_%APP_VERSION%_%BC_TYPE%_%BC_VERSION%_%BC_COUNTRY%.app
alcodeanalyzer                                                                                      
alcachepath         C:\agent2\_work\169\s                                                           
publishartifact     True                                                                            
publishxlif         False                                                                           
failonwarnings      False                                                                           
storageaccount                                                                                      
sastoken                                                                                            

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

*** Importing required Task-Functions

*** Artifact Type   : [OnPrem]
*** Artifact Version: [14.17]
*** Artifact Country: [de]
*** AL Source Path  : [C:\agent2\_work\169\s/MainApp]
*** AL Cache Path   : [C:\agent2\_work\169\s]

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

*** Resolving Path: [C:\agent2\_work\169\s/MainApp]
*** Resolved Path : [C:\agent2\_work\169\s\MainApp]
*** AL Source Folder      : C:\agent2\_work\169\s\MainApp
*** Resolving Path: [C:\agent2\_work\169\s]
*** AL Cache Folder       : C:\agent2\_work\169\s

*** Check BcContainerHelper
*** Load BcContainerHelper

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

 -select: Latest -version: 14.17 -type: OnPrem -country: de
*** Platform: c:\bcartifacts.cache\onprem\14.17.44663.0\platform
*** Localisation: c:\bcartifacts.cache\onprem\14.17.44663.0\de
*** BC Management DLL: C:\bcartifacts.cache\onprem\14.17.44663.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.17.44663.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:\agent2\_work\169\s\MainApp]
*** Found [2] files.
*** Extract App detail from [C:\agent2\_work\169\s\MainApp\.dependencies\Microsoft_Application_14.0.29537.0.app]
*** Extract App detail from [C:\agent2\_work\169\s\MainApp\app.json]
*** Starting Batch compile of Apps:
  * C:\agent2\_work\169\s\MainApp
*** Start Compiling: [C:\agent2\_work\169\s\MainApp]
*** Get App Information
*** Loading Json Object: [C:\agent2\_work\169\s\MainApp\app.json]
  * Id         : 60de2427-5e8a-42d6-ac9a-394eb7772bc0
  * Publisher  : Default publisher
  * Name       : ALProject
  * Description: 
*** Setting Managed App Version [C:\agent2\_work\169\s\MainApp\app.json] =>  14.0.4041.0
*** VSCode Settings: [C:\agent2\_work\169\s\MainApp\.vscode\settings.json]
*** No VSCode-Settings json found.
##[command]"Get-BCArtifactUrl" 
Name                           Value                                                                                   
----                           -----                                                                                   
select                         Latest                                                                                  
version                        14.17                                                                                   
type                           OnPrem                                                                                  
country                        de                                                                                      

*** Platform: c:\bcartifacts.cache\onprem\14.17.44663.0\platform
*** Localisation: c:\bcartifacts.cache\onprem\14.17.44663.0\de
*** VSIX Path: C:\bcartifacts.cache\onprem\14.17.44663.0\platform\ModernDev\program files\Microsoft Dynamics NAV\140\AL Development Environment\ALLanguage.vsix
*** ALC Path: C:\bcartifacts.cache\onprem\14.17.44663.0\VSIX\extension\bin\alc.exe
*** Nav.CodeAnalysis Path: C:\bcartifacts.cache\onprem\14.17.44663.0\VSIX\extension\bin\Microsoft.Dynamics.Nav.CodeAnalysis.dll
##[error]Die Datei oder Assembly "Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed" oder eine Abhängigkeit davon wurde nicht gefunden. Das System kann die angegebene Datei nicht finden.
##[section]Finishing: ALOpsAppCompiler
waldo1001 commented 3 years ago

Great! Now I have something to work with! image

We found a conscious workaround for newtonsoft.json - probably there is a bug in it - now we can test if that's the case - and solve it! 🤞🤞

waldo1001 commented 3 years ago

We have a new release, but this issue didn't make it ..

We'll try to fix it soon

waldo1001 commented 3 years ago

Hi @DanielGoehler ,

this should have been fixed in our previous release. Can you confirm?

DanielGoehler commented 3 years ago

Yes, works perfectly.