protobuf-net 中的 ArgumentOutOfRangeException
我有以下代码
<ProtoContract()> _
Public Class CtMsg
Public Sub New()
End Sub
<ProtoMember(1)> _
Public Property MessageType As MessageType = MessageType.mtMessage
End Class
<ProtoContract()> _
Public Enum MessageType
mtLogin = 4
mtAuthenticated = 1
mtHello = 2
mtLogout = 3
mtMessage = 0
End Enum
CtMsg 类在客户端上序列化正常,但在服务器上它给出以下错误
从客户端发送的数据与服务器上的逐字节完全匹配 但在反序列化过程中,它给出了以下错误,
是什么导致了该错误?
System.ArgumentOutOfRangeException occurred
Message=Specified argument was out of the range of valid values.
Parameter name: tag
Source=protobuf-net
ParamName=tag
StackTrace:
at ProtoBuf.ProtoMemberAttribute..ctor(Int32 tag, Boolean forced) in
K:\softwares\protobuf-net r278\src\protobuf-net\ProtoMemberAttribute.cs:line 45
InnerException:
我已经尝试过 v2 ,我得到了同样的错误 但是当我更改我的项目和相关参考来调试完全相同的代码时,它可以解决任何问题
,但对于发布版本,它会给出错误,仍然必须找出它在发布版本中不起作用的原因,并将发布我的发现
谢谢
i have the following code
<ProtoContract()> _
Public Class CtMsg
Public Sub New()
End Sub
<ProtoMember(1)> _
Public Property MessageType As MessageType = MessageType.mtMessage
End Class
<ProtoContract()> _
Public Enum MessageType
mtLogin = 4
mtAuthenticated = 1
mtHello = 2
mtLogout = 3
mtMessage = 0
End Enum
The class CtMsg is Serialize fine on the client but on the server it gives the below error
the data sent from client matches exactly byte by byte on the server
but during the Deserialize it gives the below error
what can be causing the error ?
System.ArgumentOutOfRangeException occurred
Message=Specified argument was out of the range of valid values.
Parameter name: tag
Source=protobuf-net
ParamName=tag
StackTrace:
at ProtoBuf.ProtoMemberAttribute..ctor(Int32 tag, Boolean forced) in
K:\softwares\protobuf-net r278\src\protobuf-net\ProtoMemberAttribute.cs:line 45
InnerException:
I have tried the v2 , i got the same exact error
but when i change my project and related references to debug the exact same code work with any issue
but for release version it gives the error , still have to find why it is not working in release version and will post my findings
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论