开发者

Mono: DateTime serialization and decimal serialization errors

开发者 https://www.devze.com 2023-02-21 02:25 出处:网络
I have problems during serialization/deserialization. I\'m using a WCF service (that used .NET framework) and a client created in Mono.

I have problems during serialization/deserialization.

I'm using a WCF service (that used .NET framework) and a client created in Mono.

The client calls the service and it receives DateTime objects. This is the error:

Exception in async operation: System.ArgumentOutOfRangeException: Value -8588999498056367604 is outside the valid range [0,3155378975999999999].
Parameter name: ticks

The other problem is the following.

The client calls an other service and retrieves a decimal value. When I run the call, the client breaks down and fires this exception:

System.NotImplementedException: ValueType 148 on node Text
  at System.Xml.XmlBinaryDictionaryReader+NodeInfo.g开发者_C百科et_Value () [0x001e8] in /Developer/MonoTouch/Source/mono/mcs/class/System.Runtime.Serialization/System.Xml/XmlBinaryDictionaryReader.cs:191

How is it possible to fix these problems? Thank you.


For your first problem, check this post:

http://lists.ximian.com/pipermail/mono-bugs/2010-December/107338.html

What is the DateTime kind? If it is Utc or Local, try sending a DateTime with DateTimeKind.Unspecified and see if you have the same issue. If so, I think you are bumping up against this bug: https://bugzilla.novell.com/show_bug.cgi?id=660424

You could test if the same issue exists in the current Mono master. Another workaround could be to just to send the DateTime as a long, and then reconstruct it on the client.

Your second problem I'm not so sure: the stack seems to reference MonoTouch? Are you running this on iPhone? A complete code sample would help here.

0

精彩评论

暂无评论...
验证码 换一张
取 消