Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7764269
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T14:52:05+00:00 2026-06-01T14:52:05+00:00

My question is related with the C# implementation of the google protocol buffers (protobuf-csharp-port,

  • 0

My question is related with the C# implementation of the google protocol buffers (protobuf-csharp-port, by jon skeet, great job!)

I am experiencing troubles with the extensions: let’s say I wrote:

  • "transport_file.proto" with a "transport message" and some code to
    deal with it "code_old".
  • and I wrote an extension of the transport message on
    "Mytransport.proto" file, and new code to read it "code_new".

I’m trying to read a new message (from MyTransport.proto) with the code_old expecting to ignore the extension, but I get an exception in the merge method from TextFormat: "transport" has no field named "whatever_new_field"

Transport.Builder myAppConfigB = new Transport.Builder();
System.IO.StreamReader fich = System.IO.File.OpenText("protocolBus.App.cfg");
TextFormat.Merge(fich.ReadToEnd(),myAppConfigB);
fich.Close();

new extended file looks like:

...
  Transport 
  { 
     TransportName: "K6Server_0"
     DllImport: "protocolBus.Transports.CentralServer"
     TransportClass: "K6Server"
     K6ServerParams
     {
        K6Server { host: "85.51.11.23" port: 40069 }
        Service: "TZinTalk"
        ...
     }
  }
...

while the old one, not extended:

...
  Transport 
  { 
     TransportName: "K6Server_0"
     DllImport: "Default"
     TransportClass: "Multicast"
  }
...

The whole idea is to use the text based protocol buffer as a config file in which I write some params, and based on one of those I load and assembly (which will read the whole message with the new extension (params to initialize the object).

Any idea? (it is a desperate question 😀 )

I’m using MSVC# 2008Express edition, protobuf-csharp-port version 0.9.1 (someday I’ll upgrade everything).

THANKS in advance.


I’m working on a non centrilized Publish-Subscribe framework of messages (for any written message in a proto file I auto create a Publish and a Subscriber class) with different transports. By the default I use multicast, but broadcast and a "UDP star" are also included. I let the extension mechanism to let people add new transports with its owm config params that should be read by my main code_old (just to load the assembly) and let the new transport (.dll) read it again (fully).
Curious? the previous, almost functional, version is in http://protocolbus.casessite.org

Update 1

Extended types in text format are enclosed in brackets (good to know, I was not aware of it 😀 ) so I should have written:

 [K6ServerParams]
 {
    K6Server { host: "85.51.11.23" port: 40069 }
    Service: "TZinTalk"
    ...
 }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T14:52:06+00:00Added an answer on June 1, 2026 at 2:52 pm

    Protocol buffers are designed to be backwards and forwards compatible when using their binary format, but certainly the current code doesn’t expect to parse the text format with unknown fields. It could potentially be changed to do that, but I’d want to check with the Java code to try to retain parity with that.

    Is there any reason you’re not using the binary representation to start with? That’s the normal intended usage, and the one where the vast majority of the work has gone in. (Having said which, it all seems a bit of a blur after this long away from the code…)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Quick question related to IIR filter coefficients. Here is a very typical implementation of
Problem Background The code in question is related to C++ implementation. We have code
I've a question related to some C# implementation on Model-View-Controller. I am fairly new
I have a question related to a template class implementation design. A template AT
I am working on this problem and had previously asked related question. Implementation of
Question related to PHP memory-handling from someone not yet very experienced in PHP: If
A question related to Regular cast vs. static_cast vs. dynamic_cast : What cast syntax
Another question related to this one . I have a List<SortableObjects> that is the
(First question related to iPhone development, so apologies for sounding off-track.) I'm creating a
I have a question related to conversion/formatting of date. I have a date,say,workDate with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.