How can I serialize an object with a Dictionary property?

前端 未结 7 530
故里飘歌
故里飘歌 2021-01-04 08:04

In the example code below, I get this error:

Element TestSerializeDictionary123.Customer.CustomProperties vom Typ System.Collec

7条回答
  •  时光说笑
    2021-01-04 09:03

    You can use Binary serialization instead. (Just make sure all your classes are marked as [Serializable]. Of course, it won't be in XML format, but you didn't list that as a requirement :)

提交回复
热议问题