Questions tagged [protogen]

20 questions
26
votes
2 answers

protobuf-net - generated class from .proto - Is repeated field supposed to be Read Only with no setter?

I am totally confused about this. I have looked around and can't seem to find a direct answer. I have a .proto file that my project, which has all been java, uses to create some messages. There is a repeated Info field. Which is a type we created.…
Mimerr
  • 390
  • 1
  • 5
  • 14
5
votes
2 answers

Using ProtoBuf-net with gRPC

I am trying to build a PoC at work that utilizes gRPC. The google document here takes us through a sample application. I was wondering if protobuf-net, and specifically protogen, had the capability to understand service definitions and classes…
Sai
  • 682
  • 2
  • 12
  • 35
4
votes
1 answer

Make PCL-friendly C# classes with protobuf-net generator

I would like to use Protocol Buffers in a Xamarin app, so I need to use a PCL project to house my non-platform-specific code. I used the protobuf-net protogen to convert a .proto file into a .cs file, but it was incompatible with PCL projects.…
John Brink
  • 546
  • 2
  • 8
  • 23
3
votes
0 answers

ts-protoc-gen appending list to repeated items

I have a proto(3) message like so: message DataAggregated { repeated Data data = 1; } message Data { string example = 1 } When generated types for this proto definition the word 'List' is appended to repeated fields, why is this, is there a…
Jay P
  • 596
  • 7
  • 23
2
votes
1 answer

Is it possible to generate C# files using protobuf-net for proto2 files with extension of 'FieldOptions'?

I have a proto file with proto2 syntax. I am trying to auto-generate C# file using the protogen. Although I can generate the file without any errors, I get an error while building the project (the C# file is part of a .Net 5 project in Visual…
nj_bubbles
  • 78
  • 12
2
votes
2 answers

Can generate optional fields correctly with protogen.exe

I've downloaded the CLI protogen.exe from here https://protogen.marcgravell.com/ and I try to generate a C# file with *Specified accessors for optional members, as stated here using this command line: protogen --csharp_out="." MyProtoFile.proto…
Nock
  • 6,561
  • 1
  • 28
  • 27
2
votes
1 answer

Protogen Vs. Protoc Compiler Options

I have some .proto files used to compile classes from Java, C++ and C#. For Java and C++ I use the Protoc compiler and for the C# I use Protogen. The scripts for the Java/C++ class creation is @ECHO OFF SET SRC_DIR=%~dp0 REM Make Java and C++ SET…
MoonKnight
  • 23,214
  • 40
  • 145
  • 277
2
votes
1 answer

Output one C# class per file with protogen?

Is it possible to have protogen output multiple files (one per class) based on a single .proto file? I'm working with a very large .proto file that outputs approx 200 classes, currently all in a single file. One of the places where I need to use the…
Matt Lacey
  • 65,560
  • 11
  • 91
  • 143
1
vote
0 answers

Protobuf-net.Protogen issues with custom options

As the name suggests, I've recently been trying to add custom options to some of my .proto files. However, it seems like the generated c# code contains a CS1503 error. Here's an example using the standalone Protogen tool syntax = "proto3"; import…
Nougat
  • 37
  • 5
1
vote
1 answer

protogen: create cs file

I am trying to use Protogen to create the C# classes this is my syntax but there is…
melom
  • 107
  • 1
  • 13
1
vote
1 answer

Generating C# file with Protogen 2.3.17 command line

I am trying to generate C# classes for my message and was able to do so with the help of the online generator here. But I wanted to try and get this working from the command line with the help of the command-line tool but have not been able to get…
Sai
  • 682
  • 2
  • 12
  • 35
1
vote
1 answer

Protogen generate List instead of int array

Protogen (langver=3) compiles repeated int32 someInt; To a int[]. Is there any way to force it to compile to System.Collections.Generic.List? Most other types (string, or custom types) compile to list. I can implement a workaround, but the…
wallacer
  • 12,855
  • 3
  • 27
  • 45
1
vote
1 answer

Use protobuf-net to convert json into object

I have been provided a c# class generated through protogen. I have a json response which I want to convert into object(map to the class generated from protogen). How can I achieve this ? The Json that I have is like: …
Nilesh Sarvaiya
  • 49
  • 3
  • 11
1
vote
1 answer

protobuf-net - protogen command line arguments

I'm trying to generate a csharp (.cs) file from a .proto file. I've downloaded protobuf-net from github and built locally, so that I can use protogen to generate .cs files. My issue is that I want it in the format that previous versions of this API…
1
vote
2 answers

ProtoGen.exe Enable service generation

From sample.proto package Busy.Proto; option optimize_for = SPEED; message BusyRequest { required string message = 1;} message BusyResponse {required string message = 1;} service BusyService {rpc Send (BusyRequest) returns…
tchelidze
  • 8,050
  • 1
  • 29
  • 49
1
2