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
https://rules.sonarsource.com/csharp/RSPEC-6930/
CSC : warning AD0001: Analyzer 'SonarAnalyzer.Rules.CSharp.BackslashShouldBeAvoidedInAspNetRoutes' threw an exception of type 'System.InvalidOperationException' with message 'Sequence contains no elements'.
Repro steps
I don't have, because can't find backslash. but it happens on project which don't have startup file and controllers
Known workarounds
Related information
SonarLint 7.8.0.88494
Visual Studio 2022 17.9.6
.net 8.0.204
SonarAnalyzer.CSharp 9.24.0.89429
Windows
The text was updated successfully, but these errors were encountered:
CSC : warning AD0001: Analyzer 'SonarAnalyzer.Rules.CSharp.BackslashShouldBeAvoidedInAspNetRoutes' threw an exception of type 'System.InvalidOperationException' with message 'Sequence contains no elements'.
Exception occurred with following context:
Compilation: X.Core
SyntaxTree: X.Core\Security\Permissions.cs
SyntaxNode: Name = "Display HR\\Recruitment report" ... [AttributeArgumentSyntax]@[4842..4881) (116,21)-(116,60)
System.InvalidOperationException: Sequence contains no elements
at System.Linq.Enumerable.Last[TSource](IEnumerable`1 source)
at System.Linq.ImmutableArrayExtensions.Last[T](ImmutableArray`1 immutableArray)
at SonarAnalyzer.Helpers.MethodParameterLookupBase`1.TryGetSymbol(SyntaxNode argument, IMethodSymbol methodSymbol, IParameterSymbol& parameter)
at SonarAnalyzer.Rules.BackslashShouldBeAvoidedInAspNetRoutesBase`1.IsRouteTemplate(SemanticModel model, SyntaxNode node)
at SonarAnalyzer.Rules.BackslashShouldBeAvoidedInAspNetRoutesBase`1.Check(SonarSyntaxNodeReportingContext c)
at SonarAnalyzer.AnalysisContext.SonarCompilationStartAnalysisContext.<>c__DisplayClass11_0`1.<RegisterNodeAction>b__0(SyntaxNodeAnalysisContext x)
at Microsoft.CodeAnalysis.Diagnostics.AnalyzerExecutor.<>c__52`1.<ExecuteSyntaxNodeAction>b__52_0(ValueTuple`2 data)
at Microsoft.CodeAnalysis.Diagnostics.AnalyzerExecutor.ExecuteAndCatchIfThrows_NoLock[TArg](DiagnosticAnalyzer analyzer, Action`1 analyze, TArg argument, Nullable`1 info, CancellationToken cancellationToken)
zsolt-kolbay-sonarsource
changed the title
SonarAnalyzer.Rules.CSharp.BackslashShouldBeAvoidedInAspNetRoutes Sequence contains no elements
Fix AD0001: Named Attribute Arguments in S6930
Apr 24, 2024
Description
https://rules.sonarsource.com/csharp/RSPEC-6930/
CSC : warning AD0001: Analyzer 'SonarAnalyzer.Rules.CSharp.BackslashShouldBeAvoidedInAspNetRoutes' threw an exception of type 'System.InvalidOperationException' with message 'Sequence contains no elements'.
Repro steps
I don't have, because can't find backslash. but it happens on project which don't have startup file and controllers
Known workarounds
Related information
The text was updated successfully, but these errors were encountered: