Skip to content

MessagePack v3 fails w/ "Warning CS8785 : Generator 'MessagePackGenerator' failed to generate source" #2092

@alexyakunin

Description

@alexyakunin

Bug description

Honestly, I don't know what causes it and how to reproduce it on a simple example. But I see lots of such messages once I try to upgrade to MessagePack v3:
image

Full error message:

CSC: Warning CS8785 : Generator 'MessagePackGenerator' failed to generate source. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'InvalidOperationException' with message 'Operation is not valid due to the current state of the object.'

Repro steps

  1. Checkout this branch: https://github.com/ActualLab/Fusion/tree/feat/messagepack3
  2. Try to compile it (dotnet build)

It produces warnings for a bunch of projects, but ActualLab.Core is the least dependent one, so maybe it makes sense to look at [MessagePackObject] types there first...

Expected behavior

No analyzer failures?

Actual behavior

Analyzer failures.

  • Version used:
  • Runtime: .NET 9

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions