[英]Does protobuf-net support System.Collections.Queue?
我使用protobuf-net而不是binaryformatter運行客戶機/服務器應用程序,並且遇到下一個異常: “未為類型定義序列化器:System.Collections.Queue” 。 我不太確定,可能是我做錯了什么原因...因為我已經問過字典/列表,並且支持這些類型( 我可以序列化一個對象(包含成員:字典,列表...等)並使用protobuf-net在MS.NET中反序列化它,反之亦然 。
我剛剛從這里讀到: http : //code.google.com/p/protobuf-net/wiki/GettingStarted “受支持: 實現IEnumerable並具有Add(T)方法的任何類型 ”和隊列http://msdn.microsoft .com / zh-CN / library / system.collections.queue.aspx沒有Add(T)...
問題:但是我想完全確定。 protobuf-net是否支持System.Collections.Queue ?
目前沒有:沒有。 我建議將數據視為列表以進行序列化。 作為參考, XmlSerializer
討厭它-這是Queue<string>
的XmlSerializer
輸出:
“必須在System.Collections.Generic.Queue`1 [[System.String,mscorlib,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089]]上實現默認訪問器,因為它繼承自ICollection。”
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.