Closed PhilJollans closed 9 months ago
I looked a little more into MessagePack, and it requires marking all types/properties with attributes, which is not entirely appropriate for Formatter by default.
[MessagePackObject]
public class MyClass
{
// Key attributes take a serialization index (or string name)
// The values must be unique and versioning has to be considered as well.
// Keys are described in later sections in more detail.
[Key(0)]
public int Age { get; set; }
[Key(1)]
public string FirstName { get; set; }
[Key(2)]
public string LastName { get; set; }
// All fields or properties that should not be serialized must be annotated with [IgnoreMember].
[IgnoreMember]
public string FullName { get { return FirstName + LastName; } }
}
So I changed this to SystemTextJsonFormatter for net8.0 and above
Great, thanks for looking into this problem so quickly.
Now it's available in latest dev/preview version, I will release this as stable little later.
Describe the bug
I have cloned the repo and tried to run the ConsoleApp sample.
By default, .NET 8.0 is selected.
When the client connects to the server it generates the exception:
The complete message is
The error does not occur with .NET 6.0 or .NET 7.0
Steps to reproduce the bug
Expected behavior
No response
Screenshots
No response
NuGet package version
No response
Platform
Console
IDE
Visual Studio 2022
Additional context
No response