protobuf-net

How to parse .proto file into a FileDescriptor in C#?

眉间皱痕 提交于 2021-02-19 05:55:28
问题 My goal is exactly the same as stated in this issue on github: how to read an existing .proto file and get a FileDescriptor from it I cannot use the suggested "workaround", for 2 reasons: I have "plain" .proto files, i.e.: they are text files, just like good old addressbook.proto they are not self-describing I do not want to invoke the protoc compiler as an external application. According to Marc this is possible with protobuf-net library: Without a compiled schema, you would need a runtime

How to compare two .NET object graphs for differences?

无人久伴 提交于 2021-02-18 21:09:47
问题 In our Client/Server Application we've been using BinaryFormatter for the serialization process. For performance reasons we are trying to migrate to protobuf-net ( http://code.google.com/p/protobuf-net/ ). Our software transmits huge graphs with cycles between Client and Server. Now I am looking for a way to make sure that the data which was serialized and deserialized using protobuf is exactly the same as the one which was usually processed by BinaryFormatter. A bit by bit comparison is

Protogen generate List<int> instead of int array

ぃ、小莉子 提交于 2021-02-10 16:51:46
问题 Protogen (langver=3) compiles repeated int32 someInt; To a int[] . Is there any way to force it to compile to System.Collections.Generic.List<int> ? Most other types (string, or custom types) compile to list. I can implement a workaround, but the cleanest solution for me would be if this could unpack my buffer to a List<int> 回答1: Right now: no, not without editing some C#. I have on my list adding the ability to choose list/lookup types for a range of reasons including this. I'll try to make

Protogen generate List<int> instead of int array

这一生的挚爱 提交于 2021-02-10 16:50:58
问题 Protogen (langver=3) compiles repeated int32 someInt; To a int[] . Is there any way to force it to compile to System.Collections.Generic.List<int> ? Most other types (string, or custom types) compile to list. I can implement a workaround, but the cleanest solution for me would be if this could unpack my buffer to a List<int> 回答1: Right now: no, not without editing some C#. I have on my list adding the ability to choose list/lookup types for a range of reasons including this. I'll try to make

protobuf-net AddField ignores IgnoreListHandling

不羁的心 提交于 2021-02-10 07:36:15
问题 I have this data structure declaration: [ProtoContract] public class NotACollectionHolder { public NotACollection some_objects; } [ProtoContract(IgnoreListHandling = true, ImplicitFields = ImplicitFields.AllPublic)] public class NotACollection : IEnumerable<int> { public int some_data; // something looks like a collection API public void Add(int a) { } public IEnumerator<int> GetEnumerator() { throw new NotImplementedException(); } IEnumerator IEnumerable.GetEnumerator() { throw new

Protobuf-net has missing dependency System.Private.ServiceModel

こ雲淡風輕ζ 提交于 2021-02-08 10:00:12
问题 We have a project that uses protobuf-net for serialising and deserialising our protobuf messages. It builds fine on windows, but on our Linux build environment we seem to end up missing a dependency. When the dotnet core 2.1 service runs up we get an error of: An assembly specified in the application dependencies manifest (xxxx.deps.json) was not found: package: 'System.Private.ServiceModel', version: '4.5.3' path: 'runtimes/unix/lib/netstandard2.0/System.Private.ServiceModel.dll' undefined

Protobuf-net has missing dependency System.Private.ServiceModel

淺唱寂寞╮ 提交于 2021-02-08 10:00:09
问题 We have a project that uses protobuf-net for serialising and deserialising our protobuf messages. It builds fine on windows, but on our Linux build environment we seem to end up missing a dependency. When the dotnet core 2.1 service runs up we get an error of: An assembly specified in the application dependencies manifest (xxxx.deps.json) was not found: package: 'System.Private.ServiceModel', version: '4.5.3' path: 'runtimes/unix/lib/netstandard2.0/System.Private.ServiceModel.dll' undefined

Subtype fieldnumber order dependent in protobuf-net

岁酱吖の 提交于 2021-02-07 08:53:39
问题 I can see that protobuf-net seems to need to have deterministic ordering on the run type model. What's a good strategy to use without the need of having attributes on each class for the ordering. How does protobuf it self do if it were that you were implementing by attributes instead ? model.Add(typeof(IMessage), false).AddSubType(8500, typeof(DogBarkedEvent)); model.Add(typeof(IMessage), false).AddSubType(8501, typeof(DogBarkedEvent2)); if I create a new model and try to deserialize with

Subtype fieldnumber order dependent in protobuf-net

强颜欢笑 提交于 2021-02-07 08:52:36
问题 I can see that protobuf-net seems to need to have deterministic ordering on the run type model. What's a good strategy to use without the need of having attributes on each class for the ordering. How does protobuf it self do if it were that you were implementing by attributes instead ? model.Add(typeof(IMessage), false).AddSubType(8500, typeof(DogBarkedEvent)); model.Add(typeof(IMessage), false).AddSubType(8501, typeof(DogBarkedEvent2)); if I create a new model and try to deserialize with

Subtype fieldnumber order dependent in protobuf-net

北城以北 提交于 2021-02-07 08:52:00
问题 I can see that protobuf-net seems to need to have deterministic ordering on the run type model. What's a good strategy to use without the need of having attributes on each class for the ordering. How does protobuf it self do if it were that you were implementing by attributes instead ? model.Add(typeof(IMessage), false).AddSubType(8500, typeof(DogBarkedEvent)); model.Add(typeof(IMessage), false).AddSubType(8501, typeof(DogBarkedEvent2)); if I create a new model and try to deserialize with