StefanMaron / BusinessCentral.LinterCop

Community driven code linter for AL (MS Dynamics 365 Business Central)
https://stefanmaron.com
MIT License
68 stars 27 forks source link

Rule0033AppManifestRuntimeBehind - 'System.MissingMethodException' #590

Closed pri-kise closed 3 months ago

pri-kise commented 3 months ago

We receive the following warning in our Azure DevOps pipeline.

##[warning]warning AD0001: Analyzer 'BusinessCentral.LinterCop.Design.Rule0033AppManifestRuntimeBehind' threw an exception of type 'System.MissingMethodException' with message 'System.MissingMethodException: Method not found: 'Microsoft.Dynamics.Nav.CodeAnalysis.Packaging.NavAppManifest Microsoft.Dynamics.Nav.Analyzers.Common.ManifestHelper.GetManifest(Microsoft.Dynamics.Nav.CodeAnalysis.Compilation)'.

##[warning]at BusinessCentral.LinterCop.Design.Rule0033AppManifestRuntimeBehind.CheckAppManifestRuntime(CompilationAnalysisContext ctx)
##[warning]at Microsoft.Dynamics.Nav.CodeAnalysis.Diagnostics.AnalyzerExecutor.<>c__DisplayClass48_1.<ExecuteCompilationActionsCore>b__0() in X:\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\DiagnosticAnalyzer\AnalyzerExecutor.cs:line 618
##[warning]at Microsoft.Dynamics.Nav.CodeAnalysis.Diagnostics.AnalyzerExecutor.ExecuteAndCatchIfThrows_NoLock(DiagnosticAnalyzer analyzer, Action analyze, Nullable`1 info) in X:\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\DiagnosticAnalyzer\AnalyzerExecutor.cs:line 1086'

We only have on PageExtension in this app, because this is our template app.

pageextension 50000 "PTE CustomerListExt" extends "Customer List"
{
    trigger OnOpenPage();
    begin
        //Message('App published: Hello world');
    end;
}

Versions:

Arthurvdv commented 3 months ago

Unfortunately the LinterCop is only compatible with the latest AL Languague version, currently v13.0.971907.

There was a breaking change between v12 and v13 of the AL Lanuage which is releated to the error exception you're experiencing right now.

If you are using Run-ALPipeline in your build pipelines you should also load the latest compiler from the marketplace. Add -vsixFile (Get-LatestAlLanguageExtensionUrl) to do so.

pri-kise commented 3 months ago

Okay . Good to know I haven't thought of something like that.

I will try to use the Latest Version of the AL Language.

Adding this AL Language Issue for Reference: https://github.com/microsoft/AL/issues/7569

pri-kise commented 3 months ago

I've tested it with the Latest AL Language version. Now it's working fine. I will have to update our pipelines now, but at least it's working now.