ASP.NET Core SignalR supports two protocols for encoding messages: JSON and MessagePack. Try this: https://learn.microsoft.com/en-us/aspnet/core/signalr/messagepackhubprotocol
ASP.NET Core SignalR custom serialization
I am working on a project that involves the use of SignalR technology in an application based on ASP.NET Core 6.0
I want to transmit data between client and server and vice versa using a custom serializer, and not using the default JSON option.
Is this scenario possible and what are the necessary steps that must be taken?
Any idea is welcome!
I agree with LynnNiu-5125, and you can check the official doc about
JSON/MessagePack serialization options. We also should pay attention to the Note.
Sign in to comment
1 additional answer
Sort by: Most helpful
Signal/r uses json for the message payload. You can not change this. But you can serialize to string that you pass via json.