AL icon indicating copy to clipboard operation
AL copied to clipboard

AL1003: Compiler cannot find Microsoft.Dynamics.Nav.Analyzers.Common on Linux

Open HenrikSydow opened this issue 8 months ago • 2 comments

Please include the following with each issue:

1. Describe the bug Since the last update of the AL extension to version 16.0.1463980 the compiler shows warnings, only on linux, when building an app manually using alc. It cannot find Microsoft.Dynamics.Nav.Analyzers.Common in the bin/Analyzers directory. This did not happen on previous versions. Building the app on Windows does not produce any warnings.

2. To Reproduce Steps to reproduce the behavior:

  1. Download the AL extension on a Linux system: https://ms-dynamics-smb.gallerycdn.vsassets.io/extensions/ms-dynamics-smb/al/16.0.1463980/1745841513044/Microsoft.VisualStudio.Services.VSIXPackage
  2. Take any extension and compile it through the terminal using AL compiler like so:
{AL_EXTENSION_PATH}\extension\bin\linux\alc /project:"{PROJECT_PATH}" /packagecachepath:"{PROJECT_PATH}\.alpackages" /ruleset:"{PROJECT_PATH}\ruleset.json" /analyzer:"{AL_EXTENSION_PATH}\extension\bin\Analyzers\Microsoft.Dynamics.Nav.PerTenantExtensionCop.dll,{AL_EXTENSION_PATH}\extension\bin\Analyzers\Microsoft.Dynamics.Nav.AppSourceCop.dll,{AL_EXTENSION_PATH}\extension\bin\Analyzers\Microsoft.Dynamics.Nav.CodeCop.dll"

3. Expected behavior The compiler shows no errors or warnings.

4. Actual behavior The compiler cannot find Microsoft.Dynamics.Nav.Analyzers.Common and shows warnings:

warning AL1003: An instance of analyzer Microsoft.Dynamics.Nav.PerTenantExtensionCop.ExtensionHasPermissionSetEntriesForAllTables cannot be created from /home/vsts/work/1/s/AL_EXTENSION/extension/bin/Analyzers/Microsoft.Dynamics.Nav.PerTenantExtensionCop.dll : Could not load file or assembly 'Microsoft.Dynamics.Nav.Analyzers.Common, Version=16.0.22.22232, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.

warning AL1003: An instance of analyzer Microsoft.Dynamics.Nav.PerTenantExtensionCop.RuleAvoidDuplicateObjectNames cannot be created from /home/vsts/work/1/s/AL_EXTENSION/extension/bin/Analyzers/Microsoft.Dynamics.Nav.PerTenantExtensionCop.dll : Could not load file or assembly 'Microsoft.Dynamics.Nav.Analyzers.Common, Version=16.0.22.22232, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.

warning AL1003: An instance of analyzer Microsoft.Dynamics.Nav.PerTenantExtensionCop.RulePermissionSetExtensionsShouldNotIncludePermissionsForObjectsFromDifferentApplication cannot be created from /home/vsts/work/1/s/AL_EXTENSION/extension/bin/Analyzers/Microsoft.Dynamics.Nav.PerTenantExtensionCop.dll : Could not load file or assembly 'Microsoft.Dynamics.Nav.Analyzers.Common, Version=16.0.22.22232, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.

warning AL1003: An instance of analyzer Microsoft.Dynamics.Nav.PerTenantExtensionCop.Rules.Rule021DefiningReservedNamespacesNotAllowed cannot be created from /home/vsts/work/1/s/AL_EXTENSION/extension/bin/Analyzers/Microsoft.Dynamics.Nav.PerTenantExtensionCop.dll : Could not load file or assembly 'Microsoft.Dynamics.Nav.Analyzers.Common, Version=16.0.22.22232, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.

warning AL1003: An instance of analyzer Microsoft.Dynamics.Nav.CodeCop.Design.RulePermissionSetExtensionsShouldNotIncludePermissionsForObjectsFromDifferentApplication cannot be created from /home/vsts/work/1/s/AL_EXTENSION/extension/bin/Analyzers/Microsoft.Dynamics.Nav.AppSourceCop.dll : Could not load file or assembly 'Microsoft.Dynamics.Nav.Analyzers.Common, Version=16.0.22.22232, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.

warning AL1003: An instance of analyzer Microsoft.Dynamics.Nav.AppSourceCop.Extensibility.RuleAvoidDuplicateObjectNames cannot be created from /home/vsts/work/1/s/AL_EXTENSION/extension/bin/Analyzers/Microsoft.Dynamics.Nav.AppSourceCop.dll : Could not load file or assembly 'Microsoft.Dynamics.Nav.Analyzers.Common, Version=16.0.22.22232, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.

warning AL1003: An instance of analyzer Microsoft.Dynamics.Nav.AppSourceCop.Configuration.Rule008DefiningReservedNamespacesNotAllowed cannot be created from /home/vsts/work/1/s/AL_EXTENSION/extension/bin/Analyzers/Microsoft.Dynamics.Nav.AppSourceCop.dll : Could not load file or assembly 'Microsoft.Dynamics.Nav.Analyzers.Common, Version=16.0.22.22232, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.

warning AL1003: An instance of analyzer Microsoft.Dynamics.Nav.AppSourceCop.Configuration.Rule103TablesMustHavePermissionSetDefined cannot be created from /home/vsts/work/1/s/AL_EXTENSION/extension/bin/Analyzers/Microsoft.Dynamics.Nav.AppSourceCop.dll : Could not load file or assembly 'Microsoft.Dynamics.Nav.Analyzers.Common, Version=16.0.22.22232, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.

warning AL1003: An instance of analyzer Microsoft.Dynamics.Nav.CodeCop.Design.PermissionSetExtensionsShouldNotIncludePermissionsForObjectsFromDifferentApplication cannot be created from /home/vsts/work/1/s/AL_EXTENSION/extension/bin/Analyzers/Microsoft.Dynamics.Nav.CodeCop.dll : Could not load file or assembly 'Microsoft.Dynamics.Nav.Analyzers.Common, Version=16.0.22.22232, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.

5. Versions:

  • AL Language: extension 16.0.1463980
  • Visual Studio Code: Not installed
  • Business Central: Runtime in app.json is 13.0
  • List of Visual Studio Code extensions that you have installed: None
  • Operating System:
    • [ ] Windows
    • [x] Linux
    • [ ] MacOS

Final Checklist

Please remember to do the following:

  • [x] Search the issue repository to ensure you are reporting a new issue

  • [x] Reproduce the issue after disabling all extensions except the AL Language extension

  • [x] Simplify your code around the issue to better isolate the problem

Internal work item: AB#575928

HenrikSydow avatar May 06 '25 08:05 HenrikSydow

I have the same issue on Windows with 16.0.22.37955:

##[warning]./'Microsoft.Dynamics.Nav.Analyzers.Common, Version=16.0.22.37955, Culture=neutral, PublicKeyToken=31bf3856ad364e35'(,): warning :  An instance of analyzer Microsoft.Dynamics.Nav.CodeCop.Design.PermissionSetExtensionsShouldNotIncludePermissionsForObjectsFromDifferentApplication cannot be created from D:\bcartifacts.cache\alc\16.0.1479703\extension\bin\Analyzers\Microsoft.Dynamics.Nav.CodeCop.dll : Could not load file or assembly 'Microsoft.Dynamics.Nav.Analyzers.Common, Version=16.0.22.37955, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.
##[warning]./'Microsoft.Dynamics.Nav.Analyzers.Common, Version=16.0.22.37955, Culture=neutral, PublicKeyToken=31bf3856ad364e35'(,): warning :  An instance of analyzer Microsoft.Dynamics.Nav.CodeCop.Design.RulePermissionSetExtensionsShouldNotIncludePermissionsForObjectsFromDifferentApplication cannot be created from D:\bcartifacts.cache\alc\16.0.1479703\extension\bin\Analyzers\Microsoft.Dynamics.Nav.AppSourceCop.dll : Could not load file or assembly 'Microsoft.Dynamics.Nav.Analyzers.Common, Version=16.0.22.37955, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.
##[warning]./'Microsoft.Dynamics.Nav.Analyzers.Common, Version=16.0.22.37955, Culture=neutral, PublicKeyToken=31bf3856ad364e35'(,): warning :  An instance of analyzer Microsoft.Dynamics.Nav.AppSourceCop.Extensibility.RuleAvoidDuplicateObjectNames cannot be created from D:\bcartifacts.cache\alc\16.0.1479703\extension\bin\Analyzers\Microsoft.Dynamics.Nav.AppSourceCop.dll : Could not load file or assembly 'Microsoft.Dynamics.Nav.Analyzers.Common, Version=16.0.22.37955, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.
##[warning]./'Microsoft.Dynamics.Nav.Analyzers.Common, Version=16.0.22.37955, Culture=neutral, PublicKeyToken=31bf3856ad364e35'(,): warning :  An instance of analyzer Microsoft.Dynamics.Nav.AppSourceCop.Configuration.Rule008DefiningReservedNamespacesNotAllowed cannot be created from D:\bcartifacts.cache\alc\16.0.1479703\extension\bin\Analyzers\Microsoft.Dynamics.Nav.AppSourceCop.dll : Could not load file or assembly 'Microsoft.Dynamics.Nav.Analyzers.Common, Version=16.0.22.37955, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.
##[warning]./'Microsoft.Dynamics.Nav.Analyzers.Common, Version=16.0.22.37955, Culture=neutral, PublicKeyToken=31bf3856ad364e35'(,): warning :  An instance of analyzer Microsoft.Dynamics.Nav.AppSourceCop.Configuration.Rule103TablesMustHavePermissionSetDefined cannot be created from D:\bcartifacts.cache\alc\16.0.1479703\extension\bin\Analyzers\Microsoft.Dynamics.Nav.AppSourceCop.dll : Could not load file or assembly 'Microsoft.Dynamics.Nav.Analyzers.Common, Version=16.0.22.37955, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.
##[warning]./'Microsoft.Dynamics.Nav.Analyzers.Common, Version=16.0.22.37955, Culture=neutral, PublicKeyToken=31bf3856ad364e35'(,): warning :  An instance of analyzer Microsoft.Dynamics.Nav.PerTenantExtensionCop.ExtensionHasPermissionSetEntriesForAllTables cannot be created from D:\bcartifacts.cache\alc\16.0.1479703\extension\bin\Analyzers\Microsoft.Dynamics.Nav.PerTenantExtensionCop.dll : Could not load file or assembly 'Microsoft.Dynamics.Nav.Analyzers.Common, Version=16.0.22.37955, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.
##[warning]./'Microsoft.Dynamics.Nav.Analyzers.Common, Version=16.0.22.37955, Culture=neutral, PublicKeyToken=31bf3856ad364e35'(,): warning :  An instance of analyzer Microsoft.Dynamics.Nav.PerTenantExtensionCop.RuleAvoidDuplicateObjectNames cannot be created from D:\bcartifacts.cache\alc\16.0.1479703\extension\bin\Analyzers\Microsoft.Dynamics.Nav.PerTenantExtensionCop.dll : Could not load file or assembly 'Microsoft.Dynamics.Nav.Analyzers.Common, Version=16.0.22.37955, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.
##[warning]./'Microsoft.Dynamics.Nav.Analyzers.Common, Version=16.0.22.37955, Culture=neutral, PublicKeyToken=31bf3856ad364e35'(,): warning :  An instance of analyzer Microsoft.Dynamics.Nav.PerTenantExtensionCop.RulePermissionSetExtensionsShouldNotIncludePermissionsForObjectsFromDifferentApplication cannot be created from D:\bcartifacts.cache\alc\16.0.1479703\extension\bin\Analyzers\Microsoft.Dynamics.Nav.PerTenantExtensionCop.dll : Could not load file or assembly 'Microsoft.Dynamics.Nav.Analyzers.Common, Version=16.0.22.37955, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.
##[warning]./'Microsoft.Dynamics.Nav.Analyzers.Common, Version=16.0.22.37955, Culture=neutral, PublicKeyToken=31bf3856ad364e35'(,): warning :  An instance of analyzer Microsoft.Dynamics.Nav.PerTenantExtensionCop.Rules.Rule021DefiningReservedNamespacesNotAllowed cannot be created from D:\bcartifacts.cache\alc\16.0.1479703\extension\bin\Analyzers\Microsoft.Dynamics.Nav.PerTenantExtensionCop.dll : Could not load file or assembly 'Microsoft.Dynamics.Nav.Analyzers.Common, Version=16.0.22.37955, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.

rvanbekkum avatar May 06 '25 12:05 rvanbekkum

This is caused by a change where we have updated some compiler assemblies from netstandard to .net8. It can be fixed/mitigated by specifying Analyzers.Common as the first analyzer on the command line.

-a:"/<pathToAnalyzer>/\Microsoft.Dynamics.Nav.Analyzers.Common.dll"

esbenk avatar May 07 '25 11:05 esbenk