IXmlSerializable输出已更改 [英] IXmlSerializable output is changed

查看:88
本文介绍了IXmlSerializable输出已更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们已经在传递给缓存的对象上实现了IXmlSerializable,它在CTP3中工作正常,但在CTP4中,缓存不会返回与传递给缓存相同的xml。

如果我们写的话一个空元素ex。 "<名称/>"对于缓存,它返回"< name>< / name>",这对我们来说是个问题,因为 我们使用差异来知道元素是空还是空字符串。

XmlWriter.WriteElementString(" name",null)返回"< / name>"其中XmlWriter.WriteElementString(" name",String.Empty)返回"< name>< / name>",所以这是常见的用法我认为....

是这是CTP4中的错误,还是我们需要以其他方式实现序列化?

We have implemented IXmlSerializable on the object passed to the cache, and it worked fine in CTP3, but in CTP4 the cache is not returning same xml as passed to cache.

If we write a empty element ex. "<name/>" to the cache it is returned "<name></name>", this is a problem for us because we use the difference to know whether the element is null or empty string.

XmlWriter.WriteElementString("name", null) is returning "</name>" where XmlWriter.WriteElementString("name", String.Empty) is returning "<name></name>", so this is common usage i think....

Is this an error in CTP4, or do we need to implement our serialization in an other way?

推荐答案

我无法重现该问题。你有一个可以分享的样本repro吗?
I am unable to reproduce the issue. Do you have a sample repro that you can share ?


这篇关于IXmlSerializable输出已更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆