I have the following
class A : ISomthing{}
Class B : ISomthing{}
interface ISomthing{}
Class C { public ISomthing _member {get;set}}
and i try to send the following object from my .net signalR client to my hub ,I'm using signalR 2.0.2
C obj = new C();
obj._member = new A();
I receive the following error ,Could not create an instance of type ISomthing . Type is an interface or abstract class and cannot be instantiated.
In my client and server side I'm using JsonSerializer.TypeNameHandling = TypeNameHandling.Auto;
Update : The object can be serialized by it self, using the signalR serializer : var textWriter = new StringWriter(); _hubProxy.JsonSerializer.Serialize(textWriter, obj );