No announcement yet.

Protoc.exe generates code incompatible with

  • Filter
  • Time
  • Show
Clear All
new posts

    Protoc.exe generates code incompatible with

    We downloaded the latest version of protoc from
    We created a project and installed nuget package
    Wrote and compiled a .proto file:

    syntax = "proto3";

    option csharp_namespace = "Google.Protobuf.Bridge";

    message Person {
    int32 id = 1;
    string name = 2;

    Which compiled to
    using pb = global::Google.Protobuf;
    using pbc = global::Google.Protobuf.Collections;
    using pbr = global::Google.Protobuf.Reflection;
    using scg = global::System.Collections.Generic;
    namespace Google.Protobuf.Bridge {
    public sealed partial class Person : pb::IMessage<Person> {
    private static readonly pb::MessageParser<Person> _parser = new pb::MessageParser<Person>(() => new Person());

    It appears that the compiled code expects the Google.Protobuf nuget package to be included in the project. We included this nuget package and compiling the project resulted in 'missing mscorelib' errors.

    Is there another nuget package we are missing?

    Can someone post an example using Retyped.Google-protobuf?


    Hi selinc,

    Since a Bridge project can have dependencies to Bridge libraries only, I don't think it will going to work. was built as a binding package for JavaScript library:

    Unfortunately there is no much in the Protobuf JS documentation, but you can start with the following:
    1. Create a JavaScript/TypeScript project
    2. Install a NPM package containing Protobuf JS runtime
    3. Use a prebuilt JS Proto Compliler to produce js files for your proto definitions
    4. Include the generated js files into the project
    5. Create a Bridge project with nuget package
    6. Specify JavaScript project's sub-folder as a output folder for files generated by Bridge

    This is how I see it could work, hope that helps.


      Thanks for the response. We will attempt what you describe.