StefanMaron / BusinessCentral.LinterCop

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

InvalidCastException: 'Unable to cast object of type 'Microsoft.Dynamics.Nav.CodeAnalysis.Symbols.SourceChangeAddActionSymbol' to type 'Microsoft.Dynamics.Nav.CodeAnalysis.IActionSymbol'.' #645

Closed Arthurvdv closed 3 months ago

Arthurvdv commented 3 months ago

Found an issue related with https://github.com/StefanMaron/BusinessCentral.LinterCop/issues/587, where the code below throws and exception.

pageextension 50010 "Delivery Specifications" extends "Delivery Specifications"
{
    actions
    {
        addlast(Promoted)
        {
            group(Labels)
            {
                ShowAs = SplitButton;
            }
        }
    }
}

An exception of type 'System.InvalidCastException' occurred in BusinessCentral.LinterCop.dll but was not handled in user code: 'Unable to cast object of type 'Microsoft.Dynamics.Nav.CodeAnalysis.Symbols.SourceChangeAddActionSymbol' to type 'Microsoft.Dynamics.Nav.CodeAnalysis.IActionSymbol'.'
   at BusinessCentral.LinterCop.Design.Rule0016CheckForMissingCaptions.CheckForMissingCaptions(SymbolAnalysisContext context) in C:\Users\arthur.vandevondervo\repo\BusinessCentral.LinterCop\Design\Rule0016CheckForMissingCaptions.cs:line 98
   at Microsoft.Dynamics.Nav.CodeAnalysis.Diagnostics.AnalyzerExecutor.<>c__DisplayClass50_2.<ExecuteSymbolActionsCore>b__0()
   at Microsoft.Dynamics.Nav.CodeAnalysis.Diagnostics.AnalyzerExecutor.ExecuteAndCatchIfThrows_NoLock(DiagnosticAnalyzer analyzer, Action analyze, Nullable`1 info)```
Arthurvdv commented 3 months ago

This should now be resolved in the release version of v0.30.25 of the LinterCop.