kine / NVRAppDevOps

Navertica DevOps scripts for managing Microsoft Dynamics 365 Business Central Apps
31 stars 29 forks source link

Analyzer DLL Path Change in v24 #38

Closed skmcavoy closed 8 months ago

skmcavoy commented 8 months ago

The v24 VSIX has Code Analyzer DLLs in a different directory than alc.exe

They are located in alc\extension\bin\Analyzers while alc.exe is in alc\extension\bin\win32

This breaks the Code Analyzers in Compile-AppWithArtifact as they are being searched in the wrong path

https://github.com/kine/NVRAppDevOps/blob/7d4173347d238d26064aa3ad206a2130f9c1c64b/NVRAppDevOps/Compile-AppWithArtifact.ps1#L123C7-L135C10

kine commented 8 months ago

I will check. It is connected to #37 as it seems the structure of the vsix was changed. Thanks for reporting!

kine commented 8 months ago

released in v2.7.0.

Thanks for reporting!

skmcavoy commented 8 months ago

Issue remains in 2.7.0

Looking for missing MS dependencies Copying Microsoft_Application_24.0.16336.0.app .\alc.exe /project:"C:\agent_work\10\s" /packagecachepath:"C:\agent_work\10\s" /out:"C:\agent_work\10\s\redacted_24.0.51.1223.app" /analyzer:C:\Users\BuildAgent\AppData\Local\Temp\alc\extension\bin\win32\Microsoft.Dynamics.Nav.CodeCop.dll /analyzer:C:\Users\BuildAgent\AppData\Local\Temp\alc\extension\bin\win32\Microsoft.Dynamics.Nav.AppSourceCop.dll /analyzer:C:\Users\BuildAgent\AppData\Local\Temp\alc\extension\bin\win32\Microsoft.Dynamics.Nav.UICop.dll /ruleset:C:\agent_work\10\s\cmh.ruleset.json /SourceRepositoryUrl:"[redacted /SourceCommit:"b0269be88daf5371aeb0b80874baab6d7f4d358b" /BuildBy:";NVRAppDevOps, v2.7.0" /BuildUrl:"https://dev.azure.com/https://dev.azure.com/dynamixware/Customer/_build/results?buildId=1223" Microsoft (R) AL Compiler version 13.0.14.23919 Copyright (C) Microsoft Corporation. All rights reserved

Compilation started for project 'redacted' containing '411' files at '14:38:33.766'.

[error]Metadata file 'C:\Users\BuildAgent\AppData\Local\Temp\alc\extension\bin\win32\Microsoft.Dynamics.Nav.CodeCop.dll' could not be found

[debug]Processed: ##vso[task.logissue type=error;code=AL1006;]Metadata file 'C:\Users\BuildAgent\AppData\Local\Temp\alc\extension\bin\win32\Microsoft.Dynamics.Nav.CodeCop.dll' could not be found

[error]Metadata file 'C:\Users\BuildAgent\AppData\Local\Temp\alc\extension\bin\win32\Microsoft.Dynamics.Nav.AppSourceCop.dll' could not be found

[debug]Processed: ##vso[task.logissue type=error;code=AL1006;]Metadata file 'C:\Users\BuildAgent\AppData\Local\Temp\alc\extension\bin\win32\Microsoft.Dynamics.Nav.AppSourceCop.dll' could not be found

[error]Metadata file 'C:\Users\BuildAgent\AppData\Local\Temp\alc\extension\bin\win32\Microsoft.Dynamics.Nav.UICop.dll' could not be found

[debug]Processed: ##vso[task.logissue type=error;code=AL1006;]Metadata file 'C:\Users\BuildAgent\AppData\Local\Temp\alc\extension\bin\win32\Microsoft.Dynamics.Nav.UICop.dll' could not be found

Compilation ended at '14:38:35.474'.

App generation failed with exit code 1

It is still looking in the win32 folder rather than in the Analyzers folder that is in its parent.

In Compile-AppWithArtifact, if the ALC path is in then the following logic will result in incorrect paths:

 if (Test-Path (Join-Path $binPath 'Analyzers\Microsoft.Dynamics.Nav.CodeCop.dll')) {
            $AnalyzersbinPath = Join-Path $binPath 'Analyzers' #pre BCv24
        }
        else {
            $AnalyzersbinPath = $binPath  #BCv24 and later
        }
skmcavoy commented 8 months ago

Changing BCv24 line to this works: $AnalyzersbinPath = Join-Path $binPath '..\Analyzers' #BCv24 and later

kine commented 8 months ago

Thanks, I have overlooked that in the bin path is Microsoft.Dynamics.Nav.CodeAnalysis.dll and not Microsoft.Dynamics.Nav.CodeCop.dll.

kine commented 8 months ago

Published in v2.7.1