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
I get the following exception, though I can't see what code is causing this. It has me scratching my head, since I can't work out how the parent of a method declaration could be a compilation unit.
Analyzer 'StyleCop.Analyzers.DocumentationRules.SA1600ElementsMustBeDocumented' threw the following exception:
'System.InvalidCastException: Unable to cast object of type 'Microsoft.CodeAnalysis.CSharp.Syntax.CompilationUnitSyntax' to type 'Microsoft.CodeAnalysis.CSharp.Syntax.BaseTypeDeclarationSyntax'.
at StyleCop.Analyzers.Helpers.AccessLevelHelper.GetEffectiveAccessibility(BaseMethodDeclarationSyntax syntax, SemanticModel semanticModel, CancellationToken cancellationToken)
at StyleCop.Analyzers.DocumentationRules.SA1600ElementsMustBeDocumented.Analyzer.HandleMethodDeclaration(SyntaxNodeAnalysisContext context)
at StyleCop.Analyzers.AnalyzerExtensions.<>c__DisplayClass2_0`1.<RegisterSyntaxNodeActionHonorExclusions>b__0(SyntaxNodeAnalysisContext c)
at Microsoft.CodeAnalysis.Diagnostics.AnalyzerExecutor.<>c__DisplayClass35_0`1.<ExecuteSyntaxNodeAction>b__1()
at Microsoft.CodeAnalysis.Diagnostics.AnalyzerExecutor.ExecuteAndCatchIfThrows_NoLock(DiagnosticAnalyzer analyzer, Action analyze)'.
The text was updated successfully, but these errors were encountered:
I didn't think that was ever valid C# syntax. Delegates can be outside of a type, but I wouldn't have thought that they would come through as BaseMethodDeclarationSyntax.
Could the exception have been thrown on incomplete code while I was typing in the editor? I can't reproduce that though.
I get the following exception, though I can't see what code is causing this. It has me scratching my head, since I can't work out how the parent of a method declaration could be a compilation unit.
The text was updated successfully, but these errors were encountered: