Skip to content

InvalidCastException when generating source (since 2.0.3) #16

@jhartmann123

Description

@jhartmann123

When I updated to 2.1.0 the following message started to appear when compiling:

Warning	CS8785
    Generator 'ProjectionExpressionGenerator' failed to generate source. It will not contribute to the output and compilation errors may occur as a result. 
    Exception was of type 'InvalidCastException' with message 'Unable to cast object of type 'Microsoft.CodeAnalysis.CSharp.Syntax.MemberAccessExpressionSyntax' to type 'Microsoft.CodeAnalysis.CSharp.Syntax.SimpleNameSyntax'.'

Attached is a repro. It still works with 2.0.2. Starting with 2.0.3 this message appears.

Projectables.Repro.zip

Note: I always had to rebuild twice when switching versions in order to have the warning vanish/reappear.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions