Cannot get GetSerializer for DataSet
Hi,
When I try GetSerializer for DataSet:
var serializer = MsgPack.Serialization.SerializationContext.Default.GetSerializer<DataSet>();
It thow exception:
An unhandled exception of type 'System.NotSupportedException' occurred in MsgPack.dll Additional information: This operation is not supported because 'System.ComponentModel.ISite' cannot be instanciated.
How can I resolve it ?
Sorry for delay. It is by design, and I think it is best way to implement own serializer for DataSet.
You can do it with implement MessagePackSerializer<DataSet> class and register it through SerializationContext.RegisterSerializer method. It is not easy because DataSet is relatively complex even if it is possible to implement.
As far as I imagine, you have to resolve:
- You should consider relationships. I think ignoring them is not so bad.
- You also have to implement serializer for
DataTableandDataRow. It looks reasonable that yourDataTablewill be serialized asDataColumnarray and array of eachDataRowserialized as msgpack array.