HodorNV / ALOps

ALOps
59 stars 24 forks source link

Microsoft Base Application 23.1 not compiling with ALOpsAppCompiler@1 #699

Open innonav-dev opened 10 months ago

innonav-dev commented 10 months ago

Describe the bug When we try to build our custom MS Base App on BC 23.1, we get compile errors that dotnet assemblies are missing.

the used yaml

  - task: ALOpsDockerCreate@1
    displayName: "ALOPS - Create Docker Image"
    inputs:
      artifactversion: 23.1
      artifactcountry: ch
      artifacttype: OnPrem
      forcecreateimage: false
      memory: 32G

  - task: ALOpsDockerStart@1
    displayName: 'ALOPS - Start Docker Container'      

  - task: ALOpsDockerWait@1
    displayName: 'ALOPS - Wait for Docker Container to start'
    inputs:
      search_string: 'Ready for connections!'
      setup_working_folder: true

  - task: ALOpsAppCompiler@1
    displayName: 'ALOPS - Compile Extension: App'
    inputs:
      usedocker: true
      targetproject: '${{parameters.appSourceFolder}}/app.json'
      ruleset: 'c:/Run/DevOps/${{parameters.appSourceFolder}}/ruleset.json'
      nav_app_version: "23.1.[yyyyWW].*"
      app_file_suffix: '_APP'
      publish_artifact: false
      additionalprobingpaths: |
        C:\Program Files\Microsoft Dynamics NAV\230\Service\Add-ins
        C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\6.0.13

the output Without the AspNetCore directory:

[error]c:\Run\DevOps\MSBaseApplication\App\dotnet.al(122,14): error AL0451: An assembly named 'Microsoft.AspNetCore.StaticFiles, PublicKeyToken=null' could not be found in the assembly probing paths 'C:\Program Files\Microsoft Dynamics NAV\230\Service\Add-ins, C:\Windows\assembly, C:\Windows\Microsoft.NET\assembly, C:\program files\microsoft dynamics nav\230\service\Management, C:\Windows\Microsoft.NET\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089, C:\Windows\Microsoft.NET\assembly\GAC_64\mscorlib\v4.0_4.0.0.0__b77a5c561934e089'
[error]c:\Run\DevOps\MSBaseApplication\App\System\FileManagement.Codeunit.al(335,43): error AL0185: DotNet 'FileExtensionContentTypeProvider' is missing

With the AspNetCore directory:

...
[error]c:\Run\DevOps\MSBaseApplication\App\System\OpenXMLManagement.Codeunit.al(537,52): error AL0133: Argument 1: cannot convert from 'DotNet "DocumentFormat.OpenXml.Spreadsheet.Run"' to 'DotNet "DocumentFormat.OpenXml.OpenXmlElement"'
[error]c:\Run\DevOps\MSBaseApplication\App\System\OpenXMLManagement.Codeunit.al(537,57): error AL0133: Argument 2: cannot convert from 'DotNet "DocumentFormat.OpenXml.Spreadsheet.Text"' to 'DotNet "DocumentFormat.OpenXml.OpenXmlElement"'
[error]c:\Run\DevOps\MSBaseApplication\App\System\OpenXMLManagement.Codeunit.al(539,52): error AL0133: Argument 1: cannot convert from 'DotNet "DocumentFormat.OpenXml.Spreadsheet.CommentText"' to 'DotNet "DocumentFormat.OpenXml.OpenXmlElement"'
[error]c:\Run\DevOps\MSBaseApplication\App\System\OpenXMLManagement.Codeunit.al(539,65): error AL0133: Argument 2: cannot convert from 'DotNet "DocumentFormat.OpenXml.Spreadsheet.Run"' to 'DotNet "DocumentFormat.OpenXml.OpenXmlElement"'
[error]c:\Run\DevOps\MSBaseApplication\App\System\OpenXMLManagement.Codeunit.al(542,36): error AL0133: Argument 1: cannot convert from 'DotNet "DocumentFormat.OpenXml.Spreadsheet.CommentList"' to 'DotNet "DocumentFormat.OpenXml.Spreadsheet.CommentList"'
[error]c:\Run\DevOps\MSBaseApplication\App\System\OpenXMLManagement.Codeunit.al(542,49): error AL0133: Argument 2: cannot convert from 'DotNet "DocumentFormat.OpenXml.Spreadsheet.Comment"' to 'DotNet "DocumentFormat.OpenXml.Spreadsheet.Comment"'
[error]c:\Run\DevOps\MSBaseApplication\App\System\OpenXMLManagement.Codeunit.al(554,26): error AL0122: Cannot implicitly convert type 'DotNet "DocumentFormat.OpenXml.Spreadsheet.SingleXmlCell"' to 'DotNet "DocumentFormat.OpenXml.Spreadsheet.SingleXmlCell"'
[error]c:\Run\DevOps\MSBaseApplication\App\System\OpenXMLManagement.Codeunit.al(555,52): error AL0133: Argument 1: cannot convert from 'DotNet "DocumentFormat.OpenXml.Spreadsheet.SingleXmlCells"' to 'DotNet "DocumentFormat.OpenXml.OpenXmlElement"'
[error]c:\Run\DevOps\MSBaseApplication\App\System\OpenXMLManagement.Codeunit.al(555,68): error AL0133: Argument 2: cannot convert from 'DotNet "DocumentFormat.OpenXml.Spreadsheet.SingleXmlCell"' to 'DotNet "DocumentFormat.OpenXml.OpenXmlElement"'
...

Expected behavior The Base Application should be compilable without adding additional add-in directories.

Additional context When we don't add any additional probing paths, most of the assemblies are missing and we get a lot of errors.

When we only add the "../Service/Add-ins" directory to the probing paths, then the AspNetCore.StaticFiles add-in is missing.

And when we add the AspNetCore directory to the probing paths, we get a lot of convertion errors regarding the OpenXML add-in. It seems that the different assembly paths contain different versions of the DocumentFormat.OpenXML assembly.

image image

We also compared the new build to our old succeeding build with BC version 19 and saw that you changed one probing path from "C:\program files\microsoft dynamics nav\230\service" to "C:\program files\microsoft dynamics nav\230\service\management".

What's the reason behind this and can you fix the probing paths for BC 23.1 so that the Base Application is compilable again?

innonav-dev commented 10 months ago

@AdminHodor @waldo1001 Any updates on this matter?

Kind regards.

waldo1001 commented 10 months ago

We have absolutely no clue why it doesn't work anymore. Is there documentation to how to compile the baseapp? What the settings are?

The changed probing path was necessary - I just don't remember why. It was yet another undocumented change in how they build artifacts 🙄.

waldo1001 commented 9 months ago

Changes in probing paths was necessary because of difference in versions when they included the "code .net" stuff .. .

As we are not able to repro, we did some changes. When published, I'll ask you to test again.

waldo1001 commented 8 months ago

We can't reproduce, but we have investigated and have a clue why it might fail on your end.

waldo1001 commented 1 month ago

Fixed in v1.466