Questions tagged [protobuf-csharp-port]

"Protocol Buffers" is a binary serialization format and technology, released to the open source community by Google in 2008. There are various implementations of Protocol Buffers in .NET. This project is a fairly close port of the Google Java implementation.

40 questions
16
votes
2 answers

Google Protobuf 3.0.0 assemblies for C#

In our project we successfully use Google Protobuf for C++. Now there is a need to compile the same *.proto file to use it in C# code. I downloaded the recent Protobuf version 3.0.0-alpha-3. It provides support of proto2 format for C#, which is…
Vivit
  • 1,919
  • 2
  • 24
  • 40
11
votes
5 answers

Protocol buffers and enums combinations?

This is my proto file : message MSG { required MsgCodes MsgCode = 1; optional int64 Serial = 2; // Unique ID number for this person. required int32 From = 3; required int32 To = 4; //bla bla... enum MsgCodes { …
Royi Namir
  • 131,490
  • 121
  • 408
  • 714
9
votes
3 answers

How to convert string to ByteString when using protobuf?

I want to convert a string object to ByteString.I have tried to use ByteString.CopyFrom() function to convert,but the return value is always "{Google.ProtocolBuffers.ByteString}".Why? How can I do? The function i use like this. The result
Boreas
  • 123
  • 1
  • 2
  • 6
5
votes
1 answer

ProtoBuf - Azure Service Fabric

I am looking at replacing the default serializer for RPC in ASF. This involves implementing a few interfaces, one of which is passed between services communicating via RPC public interface IServiceRemotingResponseMessageBody { void Set(object…
5
votes
2 answers

compile protocol buffers 3 timestamp type in c# visual studio?

Visual Studio 2015 C# NuGet Packages : Google.Protobuf v3.0.0 Google.Protobuf.Tools v3.0.0 MessageType Quake syntax = "proto3"; import "google/protobuf/timestamp.proto"; message Quake { google.protobuf.Timestamp _timestamp = 1; double…
4
votes
2 answers

How to set a value for a protobuf map property in C#

I have the following protoc3 message: message LocalizedString { map translations = 1 } When compiled into C#, I get the following autogenerated code: using pb = global::Google.Protobuf; using pbc =…
PassKit
  • 11,304
  • 4
  • 50
  • 71
3
votes
0 answers

Proto 3: inheritance format message

I am writing a generic SDK in which i am planning to use Protobuf (due to its advantages). I would have a generic header message as below class Header { string Id; Datetime Timestamp; string ProcessName; //This is the Process in my server …
3
votes
0 answers

How do I send Protobufs across WCF method calls?

I've written and compiled some .proto files using the protobuf-csharp-port runtime, and I'm trying to return one as the response to a WCF method call. Here's my service: [ServiceContract] public interface IService { [OperationContract] …
simonwo
  • 2,524
  • 1
  • 15
  • 27
2
votes
1 answer

How to support C# dynamic types in an gRPC proto file

We have a POST action in our asp.net core application that accepts a dynamic object. [HttpPost] public Task SubmitAsync(dynamic unitOfWork) We'd like to transform this POST action to a gRPC server and we'd like to continue receiving…
Arash
  • 2,451
  • 3
  • 32
  • 52
2
votes
1 answer

C# Protobuf Deserialization

Why is protobuf deserialization not working for OffsetDictionary member variable? It works fine if I don't use Dictionary as backing field. Also, it works fine if the type of OffsetDictionary is changed from complex type to simple SortedDictionary.…
nnk
  • 61
  • 1
  • 1
  • 4
2
votes
2 answers

Automapper IEnumerable within class is not being mapped to RepeatedField

I want to map between two classes: public class A { public IEnumerable someList } and public class B { public RepeatedField someList } where RepeatedField is a class from Google.Protobuf.Collections that handles gRPC data. EDIT: As…
more whirlpools
  • 305
  • 1
  • 2
  • 15
2
votes
1 answer

Repeated Int32Value in protobuf3 (nullable int array)

I have the following protobuf message protocol: message TestMsg { int32 int = 1; google.protobuf.Int32Value nullable_int = 2; repeated google.protobuf.Int32Value nullable_int_array = 3; // Runtime fail } protoc compiles it fine and in C# all…
maloo
  • 343
  • 1
  • 3
  • 13
2
votes
2 answers

Protobuf InvalidProtocolBufferException with some strings

We using protobuf v.3 to transfer messages from C# client to Java server over HTTP. The message proto looks like this: message CLIENT_MESSAGE { string message = 1; } Both client and server uses UTF-8 character encoding for strings. Everything…
NewJ
  • 319
  • 2
  • 14
2
votes
1 answer

Does Google.Protobuf support .NET Core?

I know from looking at the Google.Protobuf Git that there are some comments about .NET Core support but when I get a copy of the source code from Git the Google.Protobuf Project has .NetFramework 4.5 listed in the Dependencies along with…
Mytheral
  • 3,865
  • 7
  • 32
  • 56
2
votes
1 answer

Protobuf exception - Object reference not set to an instance of an object

I am trying to serialize my below class using protobuf but it is failing with "Object reference" error. more details as below. Any idea what could be wrong by looking into error details? Note: My User object is too large and it has so many child…
Pratik Mehta
  • 1,192
  • 2
  • 12
  • 35
1
2 3