Hello,
We are using SonarAnalyzer.CSharp version 8.26.0.34506 as nuget package and when randomly analyze our code it throws this exception:
CSC : error AD0001: Analyzer 'SonarAnalyzer.Rules.CSharp.StringConcatenationInLoop' threw an exception of type
'System.NullReferenceException' with message 'Object reference not set to an instance of an object.'.
CSC : error AD0001: Analyzer 'SonarAnalyzer.Rules.SymbolicExecution.SymbolicExecutionRunner' threw an exception of type
'SonarAnalyzer.SymbolicExecution.SymbolicExecutionException' with message 'Error processing method:
BindModelAsync ## Method file: C:\xxxxxxxxxxx.cs ##
Method line: xxxx ## Inner exception: System.NullReferenceException: Object reference not set to an instance of an object. ##
at Microsoft.CodeAnalysis.CSharp.SymbolDisplayVisitor.AddTupleTypeName(INamedTypeSymbol symbol) ##
at Microsoft.CodeAnalysis.CSharp.SymbolDisplayVisitor.AddNameAndTypeArgumentsOrParameters(INamedTypeSymbol symbol) ##
at Microsoft.CodeAnalysis.CSharp.SymbolDisplayVisitor.MinimallyQualify(INamedTypeSymbol symbol) ##
at Microsoft.CodeAnalysis.CSharp.SymbolDisplayVisitor.VisitNamedTypeWithoutNullability(INamedTypeSymbol symbol) ##
at Microsoft.CodeAnalysis.CSharp.SymbolDisplayVisitor.VisitNamedType(INamedTypeSymbol symbol) ##
at Microsoft.CodeAnalysis.CSharp.SymbolDisplay.ToDisplayParts(ISymbol symbol, SemanticModel semanticModelOpt, Int32 positionOpt, SymbolDisplayFormat format, Boolean minimal) ##
at Microsoft.CodeAnalysis.CSharp.Symbols.PublicModel.Symbol.Microsoft.CodeAnalysis.ISymbol.ToDisplayString(SymbolDisplayFormat format) ##
at SonarAnalyzer.Helpers.TypeHelper.IsMatch(ITypeSymbol typeSymbol, KnownType type) ##
at SonarAnalyzer.SymbolicExecution.SymbolicValue.Create(ITypeSymbol type) ##
at SonarAnalyzer.SymbolicExecution.CSharpExplodedGraph.VisitTuple(TupleExpressionSyntaxWrapper tuple, ProgramState programState) ##
at SonarAnalyzer.SymbolicExecution.CSharpExplodedGraph.VisitInstruction(ExplodedGraphNode node) ##
at SonarAnalyzer.SymbolicExecution.AbstractExplodedGraph.Walk() ##
at SonarAnalyzer.Rules.SymbolicExecution.SymbolicExecutionRunner.Analyze(CSharpExplodedGraph explodedGraph, SyntaxNodeAnalysisContext context) ##
at
If we reanalyze our code it doesn’t show the error again, so we haven’t found a way to always reproduce it