How to XML serialize and deserialize an instance of Dictionary <type, List<Action<T>>>?

情到浓时终转凉″ 提交于 2019-12-25 06:55:26

问题


I want to serialize and deserialize my dictionary object of type Dictionary <type, List<Action<T>>>. I tried using XMLserializer - it fails.

Cannot serialize member MyClass.MyDictionary of type System.Collections.Generic.Dictionary‘2[[System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], because it implements IDictionary.

I am using .NET framework 4.0. What is the right way to do this?

来源:https://stackoverflow.com/questions/10830260/how-to-xml-serialize-and-deserialize-an-instance-of-dictionary-type-listactio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!