Skip to content

LibraryImport analyzer crashes when encountering certain attributes #75706

@tannergooding

Description

@tannergooding

Repro

  1. git clone https://github.com/terrafx/terrafx.interop.windows
  2. Open the solution in VS 2022 (17.4.0 Preview 2.0)
  3. Build (and wait a minute or so)

Expected Behavior

The analyzer works and reports any bugs.

Actual Behavior

Severity	Code	Description	Project	File	Line	Suppression State	Detail Description
Error	AD0001	Analyzer 'Microsoft.Interop.Analyzers.CustomMarshallerAttributeAnalyzer' threw an exception of type 'System.InvalidOperationException' with message 'Sequence contains no elements'.	TerraFX.Interop.Windows (net6.0)	D:\Users\tagoo\source\repos\terrafx.interop.windows\sources\Interop\Windows\CSC	1	Active	Analyzer Failure
Error	AD0001	Analyzer 'Microsoft.Interop.Analyzers.NativeMarshallingAttributeAnalyzer' threw an exception of type 'System.InvalidOperationException' with message 'Sequence contains no elements'.	TerraFX.Interop.Windows (net6.0)	D:\Users\tagoo\source\repos\terrafx.interop.windows\sources\Interop\Windows\CSC	1	Active	Analyzer Failure

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions