Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LC0044 : Unhandled Exception #565

Open
jamesmayr opened this issue Mar 18, 2024 · 0 comments
Open

LC0044 : Unhandled Exception #565

jamesmayr opened this issue Mar 18, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@jamesmayr
Copy link

jamesmayr commented Mar 18, 2024

Used Version: 0.30.14
I get an exception when I want validate the following Source Code with the Business Central Linter:

Subtype = Upgrade;
    Access = Internal;

    trigger OnUpgradePerCompany()
    begin
        MigrateSetup();
        MigrateMapsMarkers();
    end;

    local procedure MigrateSetup()
    var
        _TargetMapsSetupMPIDAG: Record MapsSetupMPIDAG;
        _SourceMapsSetup11IDAG: Record MapsSetup11IDAG;
    begin
        if (_SourceMapsSetup11IDAG.FindSet()) then
            repeat
                if (not _TargetMapsSetupMPIDAG.Get(_SourceMapsSetup11IDAG.PrimaryKey)) then begin
                    _TargetMapsSetupMPIDAG.Init();
                    _TargetMapsSetupMPIDAG.SystemId := _SourceMapsSetup11IDAG.SystemId;
                    _TargetMapsSetupMPIDAG.Insert(false, true);
                end;
                _TargetMapsSetupMPIDAG.TransferFields(_SourceMapsSetup11IDAG, false);
                _TargetMapsSetupMPIDAG.Modify(false);
            until _SourceMapsSetup11IDAG.Next() = 0;
    end;

I don't know if its important, but MapsSetupMPIDAG and MapsSetup11IDAG are Tables from Extensions that are not part of the workspace.

Exception:

Unhandled exception. Unhandled exception. System.ArgumentException: Reported diagnostic 'LC0044' has a source location in file 'xxxxx/MapsSetup.Table.al', which is not part of the compilation being analyzed. (Parameter 'location')
   at Microsoft.Dynamics.Nav.CodeAnalysis.Diagnostics.DiagnosticAnalysisContextHelpers.VerifyDiagnosticLocationInCompilation(String id, Location location, Compilation compilation) in D:\a\_work\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\DiagnosticAnalyzer\DiagnosticAnalysisContextHelpers.cs:line 98
   at Microsoft.Dynamics.Nav.CodeAnalysis.Diagnostics.DiagnosticAnalysisContextHelpers.VerifyDiagnosticLocationsInCompilation(Diagnostic diagnostic, Compilation compilation) in D:\a\_work\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\DiagnosticAnalyzer\DiagnosticAnalysisContextHelpers.cs:line 81
   at Microsoft.Dynamics.Nav.CodeAnalysis.Diagnostics.DiagnosticAnalysisContextHelpers.VerifyArguments(Diagnostic diagnostic, Compilation compilationOpt, Func`2 isSupportedDiagnostic) in D:\a\_work\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\DiagnosticAnalyzer\DiagnosticAnalysisContextHelpers.cs:line 65
   at Microsoft.Dynamics.Nav.CodeAnalysis.Diagnostics.OperationAnalysisContext.ReportDiagnostic(Diagnostic diagnostic) in D:\a\_work\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\DiagnosticAnalyzer\AnalysisContext.cs:line 985
   at BusinessCentral.LinterCop.Design.Rule0044AnalyzeTransferFields.ReportFieldDiagnostics(OperationAnalysisContext ctx, Table table, List`1 fieldGroups)
   at BusinessCentral.LinterCop.Design.Rule0044AnalyzeTransferFields.AnalyzeTransferFields(OperationAnalysisContext ctx)
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_1(Object state)
   at System.Threading.QueueUserWorkItemCallbackDefaultContext.Execute()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()

When LC0044 is supressed, everything works fine.

@Arthurvdv Arthurvdv added the bug Something isn't working label Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants