You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Product and Version Used:
Roslynator.Analyzers 4.6.0, Roslynator.CodeAnalysis.Analyzers 4.6.0 and Roslynator.Formatting.Analyzers 4.6.0
.NET Framework 4.8
Visual Studio 2022
Steps to Reproduce:
We upgraded from 4.5.0 to 4.6.0 and this error started popping when building our project.
Actual Behavior:
This error is thrown when building the project.
Error AD0001 Analyzer 'Roslynator.CSharp.Analysis.InvocationExpressionAnalyzer' threw an exception of type 'System.InvalidOperationException' with message 'Object is not initialized.'.
Exception occurred with following context:
SyntaxNode: sb.AppendLine() [InvocationExpressionSyntax]@[5364..5379) (134,16)-(134,31)
System.InvalidOperationException: Object is not initialized.
at Roslynator.CSharp.Syntax.SimpleMemberInvocationExpressionInfo.get_Name()
at Roslynator.CSharp.Syntax.SimpleMemberInvocationExpressionInfo.get_NameText()
at Roslynator.CSharp.Analysis.OptimizeStringBuilderAppendCallAnalysis.Analyze(SyntaxNodeAnalysisContext context, SimpleMemberInvocationExpressionInfo& invocationInfo)
at Roslynator.CSharp.Analysis.InvocationExpressionAnalyzer.AnalyzeInvocationExpression(SyntaxNodeAnalysisContext context)
at Microsoft.CodeAnalysis.Diagnostics.AnalyzerExecutor.<>c__49`1.<ExecuteSyntaxNodeAction>b__49_0(ValueTuple`2 data)
at Microsoft.CodeAnalysis.Diagnostics.AnalyzerExecutor.ExecuteAndCatchIfThrows_NoLock[TArg](DiagnosticAnalyzer analyzer, Action`1 analyze, TArg argument, Nullable`1 info, CancellationToken cancellationToken)
-----
Suppress the following diagnostics to disable this analyzer: RCS1015, RCS1068, RCS1077, RCS1080, RCS1097, RCS1107, RCS1112, RCS1112FadeOut, RCS1128, RCS1151, RCS1155, RCS1186, RCS1197, RCS1198, RCS1200, RCS1201, RCS1202, RCS1235, RCS1246
From the following code.
StringBuildersb=new();if(bPrintWarnings&&HasWarning){<------ Line 134
sb.AppendLine();<------
sb.AppendFormat(CultureInfo.InvariantCulture,"{0} configuration warning{1} found", m_warnings.Count, m_warnings.Count >1?"s":string.Empty).AppendLine();
sb.AppendLine(ToStringSeparator);foreach(ConfigurationWarning warning in m_warnings){
sb.AppendLine(warning.ToString());
sb.AppendLine(ToStringSeparator);}}
Expected Behavior:
No error
The text was updated successfully, but these errors were encountered:
Product and Version Used:
Roslynator.Analyzers 4.6.0, Roslynator.CodeAnalysis.Analyzers 4.6.0 and Roslynator.Formatting.Analyzers 4.6.0
.NET Framework 4.8
Visual Studio 2022
Steps to Reproduce:
We upgraded from 4.5.0 to 4.6.0 and this error started popping when building our project.
Actual Behavior:
This error is thrown when building the project.
From the following code.
Expected Behavior:
No error
The text was updated successfully, but these errors were encountered: