我正在使用Visual Studio创建的WCF服务。
我正在调用GetDataAsync(param)以检索数据。在GetDataCompleted处理程序中,我正在使用检索到的数据。
服务有效运行。有时我无法检索数据。在这种情况下,会发生以下异常:
Exception in async operation: System.Net.ProtocolViolationException: The number of bytes to be written is greater than the specified ContentLength.
at System.Net.WebConnectionStream.CheckWriteOverflow (Int64 contentLength, Int64 totalWritten, Int64 size) [0x00038] in /Developer/MonoTouch/Source/mono/mcs/class/System/System.Net/WebConnectionStream.cs:546
如何捕获类似的异常?应用程序仍在运行,但异常已在控制台打印出来。我认为这个异常是来自通道或其他东西。
提前谢谢。