You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
ConsoleApp.MyMessage is not registered in resolver: MessagePack.Resolvers.StandardResolver
The complete message is
Client named_pipe_test_server_021d8e5e-1e5d-4d21-9abd-4cba84e491db is now connected!
Exception: MessagePack.MessagePackSerializationException: Failed to serialize System.Object value.
---> MessagePack.FormatterNotRegisteredException: ConsoleApp.MyMessage is not registered in resolver: MessagePack.Resolvers.StandardResolver
at MessagePack.FormatterResolverExtensions.Throw(Type t, IFormatterResolver resolver)
at MessagePack.FormatterResolverExtensions.GetFormatterDynamicWithVerify(IFormatterResolver resolver, Type type)
at MessagePack.Formatters.DynamicObjectTypeFallbackFormatter.Serialize(MessagePackWriter& writer, Object value, MessagePackSerializerOptions options)
at MessagePack.MessagePackSerializer.Serialize[T](MessagePackWriter& writer, T value, MessagePackSerializerOptions options)
--- End of inner exception stack trace ---
at MessagePack.MessagePackSerializer.Serialize[T](MessagePackWriter& writer, T value, MessagePackSerializerOptions options)
at MessagePack.MessagePackSerializer.Serialize[T](T value, MessagePackSerializerOptions options, CancellationToken cancellationToken)
at H.Formatters.MessagePackFormatter.SerializeInternal(Object obj) in C:\GitHub\H.Pipes\src\libs\H.Formatters.MessagePack\MessagePackFormatter.cs:line 12
at H.Formatters.FormatterBase.Serialize(Object obj) in C:\GitHub\H.Pipes\src\libs\H.Formatters\FormatterBase.cs:line 28
at H.Pipes.PipeConnection`1.WriteAsync(T value, CancellationToken cancellationToken) in C:\GitHub\H.Pipes\src\libs\H.Pipes\PipeConnection.cs:line 162
at ConsoleApp.MyServer.<>c__DisplayClass1_0.<<RunAsync>b__0>d.MoveNext() in C:\GitHub\H.Pipes\src\samples\ConsoleApp\MyServer.cs:line 30
The error does not occur with .NET 6.0 or .NET 7.0
Steps to reproduce the bug
In the project ConsoleApp, select .NET 8.0. This is the default.
Compile the solution
Start the ConsoleApp and enter SERVER
Start the ConsoleApp and enter CLIENT
At this point the client connects to the server and the server generates an exception
Expected behavior
No response
Screenshots
No response
NuGet package version
No response
Platform
Console
IDE
Visual Studio 2022
Additional context
No response
The text was updated successfully, but these errors were encountered:
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
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
The text was updated successfully, but these errors were encountered: