如何将XML反序列化的未知类型的对象?如何将、对象、类型、序列化

由网友(誰让莪de殇縌流成河)分享简介:我要救我的目标硬盘(如高速缓存)与的XmlSerializer 。在这种情况下,我没有任何问题。I want to save my object to hard disk (like cache) with XmlSerializer. In this case, I don't have any problem....

我要救我的目标硬盘(如高速缓存)与的XmlSerializer 。在这种情况下,我没有任何问题。

I want to save my object to hard disk (like cache) with XmlSerializer. In this case, I don't have any problem.

不过,当我想反序列化这个XML到一个对象,我得到一个错误。有什么办法 反序列化XML到不明物体,或者是我创建的对象?

However, when I want to deserialize this XML to an object, I get an error. Is there any way to deserialize XML to an unknown object or to an object that I created?

推荐答案

有没有办法在.net反序列化到不明物体。

There is no way in .Net to deserialize to unknown object.

要成功序列化/反序列化的XML对象的类必须有默认的构造函数。最好的办法是向我们展示了确切的错误信息。你能做到吗?

To successfully serialize/deserialize an XML object the class must have default constructor. The best way is to show us the exact error message. Can you do that?

阅读全文

相关推荐

最新文章