ICode9

精准搜索请尝试: 精确搜索
  • C#-protobuf-net-列出支持的类型2019-12-11 06:09:43

    我正在开发一个自定义的ProtoBufFormatter(:MediaTypeFormatter),它能够将自己的类型动态注册到用于序列化/反序列化的RuntimeTypeModel. 为了减少对try {} catch {}块的需求,在将已经支持的类型添加到RuntimeTypeModel之前,最好先过滤掉它们.自述文件仅提供默认情况下受支持的“模

  • C#-Protobuf-net枚举序列化行为在版本中更改. 2.3.02019-12-11 02:07:18

    如果2.3.0之前的任何序列化对象包含枚举值并且使用带有InferTagFromNameDefault而不是ProtoMember的DataMember,则在2.3.0或更高版本中将无法正确反序列化. [DataContract] public class ClassWithEnum { [DataMember] public MyEnum Enum { get; set; } } public enum M

  • c#-如何使用protobuf-net嵌入类型信息以进行反序列化?2019-12-08 03:06:54

    我希望能够以保留/嵌入类型信息的方式序列化IMessage的具体实例(类似于Json.NET中的可用信息),以便在反序列化时可以使用类型信息来实现这些信息具体实例.我很清楚下面的反序列化方法不起作用.任何有关如何更改它们以使它们起作用的指导将不胜感激. public interface IMessage {}

  • CodeGo.net>如何找到我刚刚用protobuf-net反序列化的消息?2019-11-27 19:06:12

    一段时间以来,我一直很高兴在某些C应用程序之间使用protobuf ZeroMQ.我需要编写一个C#应用程序.我已经使Protobuf-NET正常工作,并且我相信我终于可以解决如何从ZeroMQ消息中反序列化了,但是我一生无法解决如何查看反序列化数据中的消息. 在我的C应用程序中,我将反序列化为一个类,并

  • CodeGo.net>如何使用protobuf-net回读附加对象?2019-11-22 22:06:40

    我使用protobuf-net序列化将实时事件附加到文件流中.如何将所有保存的对象流回进行分析?我不想使用内存中的集合(因为它会很大). private IEnumerable<Activity> Read() { using (var iso = new IsolatedStorageFileStream(storageFilename, FileMode.OpenOrCreate, FileAccess.R

  • protobuf-net:如何在C#中表示DateTime?2019-11-18 05:17:05

    protogen.exe会为long类型的proto2消息字段生成此模式: private long _Count = default(long); [global::ProtoBuf.ProtoMember(1, IsRequired = false, Name=@"Count", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue

  • c#-找不到类型或名称空间名称“ ProtoBuf”2019-11-02 19:09:23

    我是C#语言的新手,所以我只是不明白为什么我的构建会产生如下错误消息. The type or namespace name 'ProtoBuf' could not be found(are you missing a using directive or an assembly reference?) 有趣的是,如果我以“ .NET Framework 3.5”为目标,则不会出错,但是一旦将项目

  • c#-使用WCF和F#在进程之间进行通信2019-11-02 07:08:14

    我想使用F#在两个长时间运行的F#进程之间进行简单的一对一通信.他们将在每个ca定期交换信息. 5秒.到目前为止,我已经达到了这一点: #r "System.ServiceModel" #r "System.Runtime.Serialization" //#r @"d:\DLL\Protobuf\protobuf-net.dll" #time "on" open System.ServiceModel

  • C#-protobuf-net:如何在用户会话中存储2019-11-01 23:16:32

    我目前能够将我创建的对象存储到HttpContext.Current.Session中,并且遇到protobuf-net.是否可以通过使用protobuf序列化对象来存储对象? 似乎protobuf希望将信息存储到Stream中,所以我(可以吗?)应该将Stream对象存储到users会话中吗?还是应该先将其从Stream转换为另一种对象类型?如果是

  • C#-Protobuf.NET并列出对象的已知子类型:无法添加System.String?2019-11-01 03:05:34

    我正在尝试为如下所示的类编写序列化代码: public class EventMessage { public Dictionary<string, object> Headers { get; set; } public object Body { get; set; } } 此类中的“对象”类型成员从很小的类型(基本上限于一种装配基本CLR类型)中保存对象.所以我想我可以

  • 如何配置protobuf-net的RuntimeModel.Default以支持对SessionSecurityToken进行序列化/反序列化?2019-10-30 18:07:15

    BinaryFormatter能够简单地处理序列化: private byte[] TokenToBytes(SessionSecurityToken token) { if (token == null) { return null; } using (var memoryStream = new MemoryStream()) { var binaryFormatter = new BinaryFormatter();

  • C#-Protobuff.net无法序列化接口2019-10-26 14:08:39

    我遇到了错误 The type cannot be changed once a serializer has been generated 尝试使用Protobuff.net进行序列化时.我设法减少了查找罪魁祸首的代码,但想知道为什么它无法序列化此属性. 我找到了可以使用的有效解决方案,但对为什么此代码失败的解释感兴趣. 不会序列化: [Pro

  • Protobuf-net-序列化.NET GUID-如何在C语言中阅读此内容?2019-10-13 17:16:01

    我已经在.NET应用程序中使用Protobuf-net相对轻松地序列化了一个对象. 我还使用GetProto()命令获得了protobuf-net生成的.proto文件. 在.NET生成的.proto文件中,我的GUID字段的类型为“ bcl.guid”. 现在,我希望在C中编译.proto文件,以便可以反序列化数据. 但是,C protoc.exe编译器

  • c# – protobuf-net能处理自动只读属性吗?2019-07-11 16:07:06

    protobuf-net能否处理新的自动只读属性,即使用单个get和no私有集定义的自动属性? public class WithReadonlyProperty { public int ReadonlyProperty { get; } public WithReadonlyProperty(int val) { ReadonlyProperty = val; } } 当我这样做 RuntimeType

  • c# – Protobuf-net:无法创建抽象类的实例2019-07-10 08:05:57

    根据这里找到的代码:protobuf and List<object> – how to serialize / deserialize?我创建了一个通用的“ProtoDictionary”,其值类型为ProtoObject. 这是我的ProtoDictionary代码: public class ProtoDictionary<TKey> : Dictionary<TKey, ProtoObject> { public void Add(TKe

  • c# – 使用Protobuf-Net序列化运行时消息协议2019-06-28 23:52:14

    可以说我有一些数据 1: { 1: 0.0 2: 1 3: "2" 4: true } 但在编译时我不知道合同.但是,在运行时,我可以加载一个数据描述符,告诉我我有多少字段以及每个字段中的每种类型.即 new Type[]{ typeof(double), typeof(int), typeof(string), typeof(bool

  • c# – 从子到父的protobuf-net继承2019-06-28 17:53:56

    我有一个父母班,我想要有很多平坦的孩子.这意味着一个班级将固有10个或更多不同的班级. 这就是我所拥有的. 基类: [ProtoContract] [ProtoInclude(500, typeof(Message1Send))] [ProtoInclude(501, typeof(Message2Send))] public class MessageBase { [ProtoMember(1)] pu

  • c# – Protobuf-net无法仅使用getter序列化属性 – 无法对属性应用更改2019-06-27 23:06:16

    我使用protobuf-net来序列化一个对象,我得到了异常: 无法对属性TestProject.TestMessage.ClientId应用更改 使用stacktrace: at ProtoBuf.Serializers.PropertyDecorator.SanityCheck(TypeModel model, PropertyInfo property, IProtoSerializer tail, Boolean& writeValue, Boolean

  • c# – ProtoBuf-net AsReference需要Activator.CreateInstance中的公共构造函数吗?2019-06-26 13:55:35

    在我的两个类看起来像这样(最小) using System; using System.Collections.Generic; using System.Collections; using System.ComponentModel; using System.Drawing; using System.Windows.Forms; using System.IO; using ProtoBuf; namespace Sandbox { public partial cl

  • C#Protobuf-net:小数字字典:零不能正常往返2019-06-22 09:52:57

    我发现了protobuf-net中十进制零序列化/反序列化的一个奇怪的错误,想知道是否有人为此找到了一个好的解决方法,或者这实际上是一个功能. 鉴于上面的字典,如果我在linqpad中运行: void Main() { { Dictionary<string, decimal> dict = new Dictionary<string, decimal>(

  • c# – 通过WCF实现protobuf-net与DataContractSerializer的性能2019-06-21 11:53:23

    我测试了protobuf序列化,似乎对于一定数量的对象,它比常规的datacontract序列化慢.使用DataContractSerializer传输大小更大但在序列化和反序列化期间使用DataContractSerializer更快 你认为这是正常的还是我犯了错误? [DataContract] public partial class Toto { [DataMember

  • c# – 如何使用Protobuf.net更改类型中成员的ProtoMember索引?2019-06-21 06:55:04

    我有这样的类型: [ProtoContract] class Person { [ProtoMember(1)] public string Name {get;set:} [ProtoMember(2)] public int Id {get;set;} } 后来我意识到我需要另一个属性Age所以添加它像: [ProtoContract] class Person { [ProtoMember(1)] publ

  • c# – 检测到Protobuf-net可能的递归:序列化子项和父项2019-06-20 20:53:05

    我是序列化的新手,甚至是protobuf的新手.这是我的问题,我有这些课程: [ProtoContract] class Controle { [ProtoMember(1, AsReference=true)] public HashSet<Controle> ControlesInternes { get; set; } [ProtoMember(2)] public string TypeControle { get; set

  • c# – protobuf-net无法反序列化我的课程2019-06-13 18:55:32

    我想序列化一个’Player’类,并通过我的网络流发送给客户端. 球员类 [ProtoMember(1)] public int flag; [ProtoMember(2)] public Int16 id; [ProtoMember(3)] public MyVector3 CharPos; [ProtoMember(7)] public bool spawned; MyVector3(由

  • 使用protobuf-net生成C#时保留proto注释2019-06-13 03:02:17

    我们使用protobuf-net来处理C#应用程序中的协议缓冲区需求.由于我们将.proto文件与其他非托管应用程序共享,因此我们从.proto文件生成代码(不使用代码优先的protobuf-net方法).为了尽可能保持DRY,我们在.proto文件中保留了很多接口文档.我们通过protogen.exe生成C#代码,由项目构建

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有