Skip to content

Bumping version of MessagePack breaks source generation inside VisualStudio #371

@pziezio

Description

@pziezio

Actual behavior

f25bc2d updated MessagePack version from 2.2.x to 2.3.x which has some breaking changes regarding serialization of Dictionary<>.

Simple example fails to generate sources inside VisualStudio:
CSC : warning CS8785: Generator 'SourceGenerator' failed to generate source. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'MessagePackSerializationException' with message 'Failed to deserialize System.Collections.Generic.Dictionary2[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[Microsoft.Windows.SDK.Win32Docs.ApiDetails, Microsoft.Windows.SDK.Win32Docs, Version=0.1.4.39555, Culture=neutral, PublicKeyToken=7c40c7c34b1fcfe1]] value.

Compiling project from command line with dotnet build works without problem - that's probably why all automatic tests also works.
I've recompiled CsWin32 with MessagePack version downgraded to 2.2.x and it works again.

Repro steps

  1. NativeMethods.txt content:
CreateFile
  1. Empty console project with using Windows.Win32;

Context

  • CsWin32 version: 0.1.539-beta
  • Target Framework: net5.0
  • VisualStudio: 2019 and 2022

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions