© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
21 replies
Verdur

✅ Complicated error with C# SignalR client

Hi, I'm trying to receive base class in signalr using
connection.on
connection.on
function. My base class has inherits and they all may be sent to the client.
Problem is in
connection.on<T>
connection.on<T>
method.
It converts whatever JSON serialized data comes to it straight to the
T
T
type, ignoring
T
T
's dervied types.
I have tested it by wrapping my
Foo
Foo
class in wrapper class
Bar
Bar
and passing it to the method:
connection.On<Bar>(...)
connection.On<Bar>(...)

This way, if I store
Baz: Foo
Baz: Foo
type in
Bar
Bar
and pass it to client, it will recieve
Bar
Bar
with
foo
foo
field having
Baz
Baz
type.

Is there a way to make
connection.on<T>
connection.on<T>
convert incoming data not just to
T
T
, but to it's derivative too without using wrapper classes?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

SignalR client method calling C#/JS interop, hangs indefinitely.
C#CC# / help
3y ago
✅ SignalR client to client communication (chat)
C#CC# / help
2y ago
Deal with clients that not support signalR
C#CC# / help
4y ago
SignalR
C#CC# / help
11mo ago