Skip to content

SYSLIB1096 fails with AD0001 hundreds of times in VS codebase #119727

@AArnott

Description

@AArnott

Version Used: Dev18.0 Insiders (11012.10.main)

Steps to Reproduce:

  1. Clone the VS repo.
  2. git checkout f26718d5ace6f369f61a05895482bbb380d52aaf~
  3. Open the solution at .\src\env\shell\UIInternal\UIInternal.slnx

Diagnostic Id: AD0001 (SYSLIB1096)

If this is a report about a bug in an analyzer, please include the diagnostic ID and message if possible (e.g. "IDE0030: Use coalesce expression").

Expected Behavior:

No analyzer unhandled exceptions.

Actual Behavior:

Analyzer 'Microsoft.Interop.Analyzers.ConvertComImportToGeneratedComInterfaceAnalyzer' threw an exception of type 'System.InvalidCastException' with message 'Unable to cast object of type 'Microsoft.CodeAnalysis.CSharp.Syntax.AccessorDeclarationSyntax' to type 'Microsoft.CodeAnalysis.CSharp.Syntax.MethodDeclarationSyntax'.'.
Exception occurred with following context:
Compilation: Microsoft.VisualStudio.Interop
ISymbol: IVsAsyncSaveResult (NamedType)
 
System.InvalidCastException: Unable to cast object of type 'Microsoft.CodeAnalysis.CSharp.Syntax.AccessorDeclarationSyntax' to type 'Microsoft.CodeAnalysis.CSharp.Syntax.MethodDeclarationSyntax'.
   at Microsoft.Interop.Analyzers.ConvertComImportToGeneratedComInterfaceAnalyzer.<>c__DisplayClass3_0.<Initialize>b__2(SymbolAnalysisContext context)
   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: SYSLIB1096

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-area-labelAn area label is needed to ensure this gets routed to the appropriate area owners

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions