HodorNV / ALOps

ALOps
59 stars 24 forks source link

Could not load file or assembly 'System.IO.Packaging (ALOpsAppPublish@1) #734

Closed Arthurvdv closed 2 months ago

Arthurvdv commented 6 months ago

Describe the bug I think I've found a bug due to the refactoring.

[error]Batch App-Publish failed: Exception calling "Create" with "1" argument(s): "Could not load file or assembly 'System.IO.Packaging, Version=4.0.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified."

the used yaml please provide the yaml that you used. It helps you put the yaml like this:

parameters:
  nav_artifact_app_filter: "*.app"
  batch_publish_folder: ".apps"

steps:
  - task: ALOpsAppPublish@1
    displayName: "Publish Dependencies"
    inputs:
      usedocker: true
      nav_artifact_app_filter: ${{ parameters.nav_artifact_app_filter }}
      batch_publish_folder: ${{ parameters.batch_publish_folder }}
      skip_verification: true
      blocksymbolsonly: true

the output

2024-03-13T05:48:01.6892001Z ##[section]Starting: Publish Dependencies
2024-03-13T05:48:01.7160275Z ==============================================================================
2024-03-13T05:48:01.7160389Z Task         : ALOps App Publish
2024-03-13T05:48:01.7160443Z Description  : Publish AL Extension to Business Central
2024-03-13T05:48:01.7160522Z Version      : 1.463.5216
2024-03-13T05:48:01.7160572Z Author       : Hodor
2024-03-13T05:48:01.7160620Z Help         : Publish Business Central extension to service tier.
2024-03-13T05:48:01.7160692Z ==============================================================================
2024-03-13T05:48:02.6681260Z *** Validate configuration
2024-03-13T05:48:02.7167927Z *** Task Inputs:
2024-03-13T05:48:02.7201919Z 
2024-03-13T05:48:02.7306761Z name                                                                                                              value
2024-03-13T05:48:02.7308747Z ----                                                                                                              -----
2024-03-13T05:48:02.7310189Z usedocker                                                                                                          True
2024-03-13T05:48:02.7311370Z fixed_tag                                                                                                              
2024-03-13T05:48:02.7312931Z installpublishedapps                                                                                               True
2024-03-13T05:48:02.7314250Z installaltesttool                                                                                                 False
2024-03-13T05:48:02.7315216Z install_al_app_names                                                                             Tests-TestLibraries...
2024-03-13T05:48:02.7315858Z strictappnames                                                                                                    False
2024-03-13T05:48:02.7316868Z nav_serverinstance                                                                                                BC140
2024-03-13T05:48:02.7317833Z artifact_path                                                                                                          
2024-03-13T05:48:02.7320371Z nav_artifact_app_filter                                                                                           *.app
2024-03-13T05:48:02.7320549Z skip_verification                                                                                                  True
2024-03-13T05:48:02.7321334Z forceinstall                                                                                                      False
2024-03-13T05:48:02.7322337Z forcesync                                                                                                         False
2024-03-13T05:48:02.7323085Z publish_scope                                                                                                    Global
2024-03-13T05:48:02.7323836Z tenant                                                                                                          default
2024-03-13T05:48:02.7324880Z batch_publish_folder                                                                                              .apps
2024-03-13T05:48:02.7327517Z publisherazureactivedirectorytenantid                                                                                  
2024-03-13T05:48:02.7329553Z blocksymbolsonly                                                                                                   True
2024-03-13T05:48:02.7330393Z 
2024-03-13T05:48:02.7352904Z 
2024-03-13T05:48:02.7362145Z 
2024-03-13T05:48:02.7531322Z *** For documentation, please visit   : https://www.alops.be/documentation
2024-03-13T05:48:02.7534944Z 
2024-03-13T05:48:03.1434294Z *** ALOps License:
2024-03-13T05:48:03.1456055Z   * Licensed To: Van Roey (Collection License)
2024-03-13T05:48:03.1460467Z 
2024-03-13T05:48:03.1564860Z *** Importing required PS-Functions
2024-03-13T05:48:03.3029475Z *** Initiate Docker Session
2024-03-13T05:48:03.5269504Z *** Set Docker Container ErrorActionPreference = Stop
2024-03-13T05:48:03.7381071Z *** Start Batch App-Publish.
2024-03-13T05:48:03.7970866Z *** Copy Artifacts: [C:\azure-vsts-agent-build\_work\3262\s\.apps] to [c:\Run\DevOps\Artifacts-6b3d8af8f09f4f9fbd1ac880b65b0a92]
2024-03-13T05:48:04.4335380Z *** Import NAV/BC Management DLL's [False]
2024-03-13T05:48:04.4363898Z *** Loading assemblies for ServiceTier [BC].
2024-03-13T05:48:04.7649361Z *** Loading assemblies from: [C:\program files\microsoft dynamics nav\240\service]
2024-03-13T05:48:04.8422545Z *** BC Management DLL: C:\program files\microsoft dynamics nav\240\service\Management\Microsoft.Dynamics.Nav.Management.dll
2024-03-13T05:48:04.8490998Z *** Selected module: [C:\program files\microsoft dynamics nav\240\service\Management\Microsoft.Dynamics.Nav.Management.dll]
2024-03-13T05:48:04.8502090Z *** Loading module: [C:\program files\microsoft dynamics nav\240\service\Management\Microsoft.Dynamics.Nav.Management.dll]
2024-03-13T05:48:04.9505465Z *** BC App Management DLL: not available
2024-03-13T05:48:05.1566812Z *** Get Available Applications from [c:\Run\DevOps\Artifacts-6b3d8af8f09f4f9fbd1ac880b65b0a92].
2024-03-13T05:48:05.1664326Z *** Get [*.app] files recursive from [c:\Run\DevOps\Artifacts-6b3d8af8f09f4f9fbd1ac880b65b0a92]
2024-03-13T05:48:05.1708201Z *** Found [2] files.
2024-03-13T05:48:05.1714956Z *** Extract App detail from [C:\Run\DevOps\Artifacts-6b3d8af8f09f4f9fbd1ac880b65b0a92\VanRoey_Document Sender_23.0.129753.0_sandbox_23.4_base.app]
2024-03-13T05:48:05.7341636Z 
2024-03-13T05:48:05.7342134Z 
2024-03-13T05:48:05.7342314Z ServerInstance                        : 
2024-03-13T05:48:05.7344984Z Brief                                 : The Document Sender is an automated solution for all your document processing 
2024-03-13T05:48:05.7345232Z                                         needs.
2024-03-13T05:48:05.7345538Z Description                           : Tired of sending all those sales invoices out to your customers? Tired of 
2024-03-13T05:48:05.7345767Z                                         processing all these different documents? Well, then the Document Sender is 
2024-03-13T05:48:05.7345946Z                                         here to help you. Invoices, shipping notes, ... can be sent out. All without 
2024-03-13T05:48:05.7347625Z                                         even a single click. With the Document Sender, you can completely choose which 
2024-03-13T05:48:05.7349016Z                                         kind of documents, whether it's a pdf or an xml file, you want to process in 
2024-03-13T05:48:05.7349192Z                                         what kind of manner.
2024-03-13T05:48:05.7349335Z CompatibilityId                       : 0.0.0.0
2024-03-13T05:48:05.7349480Z PrivacyStatement                      : https://www.vanroey.be/voorwaarden/#tab4
2024-03-13T05:48:05.7349632Z Eula                                  : https://www.vanroey.be/voorwaarden/
2024-03-13T05:48:05.7350943Z Help                                  : https://www.vanroey.be/support/
2024-03-13T05:48:05.7351096Z Url                                   : https://www.vanroey.be/
2024-03-13T05:48:05.7351230Z Logo                                  : /logo/ExtensionLogo.png
2024-03-13T05:48:05.7351350Z DeveloperTenantId                     : 
2024-03-13T05:48:05.7351460Z ScreenShots                           : {}
2024-03-13T05:48:05.7352753Z Dependencies                          : {Application, Microsoft, 23.0.0.0, False}
2024-03-13T05:48:05.7352890Z Capabilities                          : {}
2024-03-13T05:48:05.7353145Z PackageId                             : b0b5ccae-877b-45b2-9fc1-b989f97de46a
2024-03-13T05:48:05.7353312Z PublisherAzureActiveDirectoryTenantId : 
2024-03-13T05:48:05.7353533Z AppId                                 : 498ca727-ae8b-49ba-9e28-d73e8d677173
2024-03-13T05:48:05.7353665Z Name                                  : Document Sender
2024-03-13T05:48:05.7353777Z Publisher                             : VanRoey
2024-03-13T05:48:05.7354636Z Version                               : 23.0.129753.0
2024-03-13T05:48:05.7355549Z ExtensionType                         : ModernDev
2024-03-13T05:48:05.7355690Z Scope                                 : Global
2024-03-13T05:48:05.7355789Z Tenant                                : 
2024-03-13T05:48:05.7355839Z 
2024-03-13T05:48:05.7355873Z 
2024-03-13T05:48:05.7355905Z 
2024-03-13T05:48:05.7355938Z 
2024-03-13T05:48:05.7455668Z *** Extract App detail from [C:\Run\DevOps\Artifacts-6b3d8af8f09f4f9fbd1ac880b65b0a92\VanRoey_<redacted>_23.2.130220.0_sandbox_23.4_be.app]
2024-03-13T05:48:06.2672586Z 
2024-03-13T05:48:06.2673018Z 
2024-03-13T05:48:06.2673240Z ServerInstance                        : 
2024-03-13T05:48:06.2673636Z Brief                                 : 
2024-03-13T05:48:06.2673768Z Description                           : 
2024-03-13T05:48:06.2673880Z CompatibilityId                       : 0.0.0.0
2024-03-13T05:48:06.2674031Z PrivacyStatement                      : https://www.vanroey.be/voorwaarden/#tab4
2024-03-13T05:48:06.2674182Z Eula                                  : https://www.vanroey.be/voorwaarden/
2024-03-13T05:48:06.2674313Z Help                                  : https://www.vanroey.be/support/
2024-03-13T05:48:06.2674442Z Url                                   : https://www.vanroey.be/
2024-03-13T05:48:06.2674568Z Logo                                  : /logo/ExtensionLogo.png
2024-03-13T05:48:06.2674680Z DeveloperTenantId                     : 
2024-03-13T05:48:06.2674790Z ScreenShots                           : {}
2024-03-13T05:48:06.2674948Z Dependencies                          : {_Exclude_APIV2_, Microsoft, 19.0.0.0, True, Application, Microsoft, 23.2.0.0, 
2024-03-13T05:48:06.2677536Z                                         False}
2024-03-13T05:48:06.2677663Z Capabilities                          : {}
2024-03-13T05:48:06.2678125Z PackageId                             : 049c156b-254b-4f4a-bc5b-4a13aaf5cab5
2024-03-13T05:48:06.2678286Z PublisherAzureActiveDirectoryTenantId : 
2024-03-13T05:48:06.2678509Z AppId                                 : 22b42e4f-a408-402e-90a1-2ebe2f331a59
2024-03-13T05:48:06.2678637Z Name                                  : <redacted>
2024-03-13T05:48:06.2678757Z Publisher                             : VanRoey
2024-03-13T05:48:06.2678875Z Version                               : 23.2.130220.0
2024-03-13T05:48:06.2678994Z ExtensionType                         : ModernDev
2024-03-13T05:48:06.2679115Z Scope                                 : Global
2024-03-13T05:48:06.2679646Z Tenant                                : 
2024-03-13T05:48:06.2679708Z 
2024-03-13T05:48:06.2679743Z 
2024-03-13T05:48:06.2679795Z 
2024-03-13T05:48:06.2679828Z 
2024-03-13T05:48:06.2745190Z *** Remove duplicate Apps
2024-03-13T05:48:06.2937072Z *** Installing Applications:
2024-03-13T05:48:06.3383646Z 
2024-03-13T05:48:06.3420067Z **************************************
2024-03-13T05:48:06.3426821Z  * App File = [C:\Run\DevOps\Artifacts-6b3d8af8f09f4f9fbd1ac880b65b0a92\VanRoey_<redacted>_23.2.130220.0_sandbox_23.4_be.app]
2024-03-13T05:48:06.3426992Z 
2024-03-13T05:48:06.8683654Z  * App.ID        = 22b42e4f-a408-402e-90a1-2ebe2f331a59
2024-03-13T05:48:06.8686841Z  * App.Name      = <redacted>
2024-03-13T05:48:06.8690426Z  * App.Publisher = VanRoey
2024-03-13T05:48:06.8711911Z  * App.Version   = 23.2.130220.0
2024-03-13T05:48:06.9066108Z *** Loading assemblies from: [C:\program files\microsoft dynamics nav\240\service]
2024-03-13T05:48:06.9615120Z *** Loading: [C:\program files\microsoft dynamics nav\240\service\Management\Microsoft.Dynamics.Nav.CodeAnalysis.dll]
2024-03-13T05:48:07.1214535Z *** Check NAVApp: VanRoey_<redacted>_23.2.130220.0_sandbox_23.4_be.app
2024-03-13T05:48:07.1991860Z Exception calling "Create" with "1" argument(s): "Could not load file or assembly 'System.IO.Packaging, Version=4.0.5.0
2024-03-13T05:48:07.1992281Z , Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specifi
2024-03-13T05:48:07.1993049Z ed."
2024-03-13T05:48:07.1993330Z At C:\azure-vsts-agent-build\_work\_tasks\ALOpsAppPublish_c004e2d2-e842-40f0-9ed4-89fb9bdd2e33\1.463.5216\c60d10bf-3ad0
2024-03-13T05:48:07.1993593Z -41f7-8c5e-95122a3f59ed.ps1:156 char:17
2024-03-13T05:48:07.1993826Z + ...             $Result = Invoke-Command -Session $DockerSession -ScriptB ...
2024-03-13T05:48:07.1993996Z +                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2024-03-13T05:48:07.1994253Z     + CategoryInfo          : NotSpecified: (:) [Check-NAVAppFile], MethodInvocationException
2024-03-13T05:48:07.1994506Z     + FullyQualifiedErrorId : FileNotFoundException,Check-NAVAppFile
2024-03-13T05:48:07.1994742Z  
2024-03-13T05:48:07.1994780Z 
2024-03-13T05:48:07.2037434Z ##[error]Batch App-Publish failed: Exception calling "Create" with "1" argument(s): "Could not load file or assembly 'System.IO.Packaging, Version=4.0.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified."
2024-03-13T05:48:07.2292528Z ##[section]Async Command Start: Add Build Tag
2024-03-13T05:48:07.2292843Z Build '133250' has following tags now: AL.Analyzer.UICop, AL.Analyzer.PerTenantExtensionCop, AL.Analyzer.CodeCop, App.<redacted>.23.2.130220.0, myimage-sandbox-24.0.16410.17308-be-10.0.20348.2322-ltsc2022, BC.Version.24.0.16410.17308, BC.Platform.24.0.17244.0
2024-03-13T05:48:07.2293092Z ##[section]Async Command End: Add Build Tag
2024-03-13T05:48:07.2293671Z ##[section]Finishing: Publish Dependencies
waldo1001 commented 6 months ago

Hi, it's the "BlockSymbolsOnly", which doesn't work in PS5. This switch to PS7 is haunting us, I'm afraid. We're not out of the woods yet.

For now, you'll have to set "blocksymbolsonly" to false, I'm afraid :(.

For CMDLets, they (MS) created a bridge, but for codeanalysis, they didn't, it seems, meaning we can't call it from PS5. Sidenote: we can't define steps in DevOps to run on PS7 ... . Workarounds are necessary (like that bridge).

Arthurvdv commented 6 months ago

Understandable, for now I'll switch off this parameter. Thanks for the quick response!

waldo1001 commented 5 months ago

This is fixed in this release. could you enable it again?

Make sure to enable the pwsh-parameter for the extension api!

waldo1001 commented 5 months ago

@Arthurvdv ?

Arthurvdv commented 5 months ago

Thanks for the reminder, this one had fallen off the table.

Make sure to enable the pwsh-parameter for the extension api!

Maybe a stupid question, but where do I enable this? 🤔

waldo1001 commented 4 months ago

Sorry about this - it will be released in the next version!