DataContract 序列化抛出安全异常
我正在尝试在 WPF 和 WP7 上使用 DataContractSerialization。在 WPF 上一切都很好,但在 WP7 上却不然。当我尝试在 wp7 上序列化对象时,收到未知的安全异常。请查看随附的源代码并帮助我。
谢谢。
I am trying to use DataContractSerialization on WPF and WP7. All things are good on WPF but not on WP7. When I tryed to serialize an object on wp7, I received an unknown security exception. Please view the attached source code and help me.
Thanks.
我有同样的问题。
在我的场景中,我试图序列化一个嵌套类。
我必须删除嵌套并将该类定义为公共类,然后它就起作用了。
I had the same issue.
In my scenario, I was trying to serialize a nested class.
I had to remove the nesting and define the class as public, and then it worked.