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

Application area issue, analyzer warning AD0001 - Rule189ApplicationAreaHasInvalidValue #7772

Open
linasostreika opened this issue Jun 18, 2024 · 1 comment

Comments

@linasostreika
Copy link

linasostreika commented Jun 18, 2024

Hi,

We found ourselfves in situation where we receive a warning from analyzer with ID AD0001, which shouldnt be considered as warning.

We have a field obsoleted on Application Area Setup extension:

tableextension 17031631 "S4LA Appl. Area Setup Ext." extends "Application Area Setup"
{
fields
{
field(17021801; "S4LA Leasing"; Boolean)
{
DataClassification = CustomerContent;
Caption = '(Obsolete) S4Leasing';
Description = 'S4Leasing new Application area';
ObsoleteState = Removed;
ObsoleteReason = 'SL63 replaced by another field S4LALeasing';
ObsoleteTag = '63.0.0.0';
}
field(17021802; S4LALeasing; Boolean)
{
Caption = 'S4LA Leasing';
DataClassification = CustomerContent;
}
}
}

Analyzer shows warning:

warning AD0001: Analyzer 'Microsoft.Dynamics.Nav.CodeCop.Design.Rule189ApplicationAreaHasInvalidValue' threw an exception of type 'System.ArgumentException' with message 'System.ArgumentException: An item with the same key has already been added. Key: S4LALeasing
at System.Collections.Generic.Dictionary2.TryInsert(TKey key, TValue value, InsertionBehavior behavior) at System.Collections.Generic.Dictionary2.Add(TKey key, TValue value)
at Microsoft.Dynamics.Nav.CodeCop.Design.Rule189ApplicationAreaHasInvalidValue.ExtractAppAreaFromFields(PooledList1 fields, PooledNameObjectDictionary1 appAreas, StringBuilder stringBuilder) in X:\Prod\Microsoft.Dynamics.Nav.CodeCop\Design\Rule189ApplicationAreaHasInvalidValue.cs:line 162
at Microsoft.Dynamics.Nav.CodeCop.Design.Rule189ApplicationAreaHasInvalidValue.GetApplicationAreas(CompilationStartAnalysisContext ctx, String& validAppAreasOrder) in X:\Prod\Microsoft.Dynamics.Nav.CodeCop\Design\Rule189ApplicationAreaHasInvalidValue.cs:line 138
at Microsoft.Dynamics.Nav.CodeCop.Design.Rule189ApplicationAreaHasInvalidValue.b__3_0(CompilationStartAnalysisContext compilationStartAnalysisContext) in X:\Prod\Microsoft.Dynamics.Nav.CodeCop\Design\Rule189ApplicationAreaHasInvalidValue.cs:line 35
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 1088'

@BazookaMusic
Copy link

BazookaMusic commented Jun 21, 2024

The error shows the analyser is crashing. It shouldn't crash, thus marking for triage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants