Messagepack, CSharp and Abstract Classes

996 Views Asked by At

I have the following Code:

 _serializerResponse = MessagePackSerializer .Get<AbstractWebResponse>();

and I try to get the MessagePackSerializer!

But it gives me the following error:

This operation is not supported because 'AbstractWebResponse' cannot be instanciated.

Yes, AbstractWebResponse can not be instaciated, but it's child classes wich I try to serialize (and deserialize) can! And I need it so, because I don't know the type of the Class at deserialization time! Is it not transmited in the data stream so this works?

0

There are 0 best solutions below