title: Reading a protobuf3 custom option from C#
body: <p><strong>TL;DR</strong></p>
  
  <p>According to the doc, if I were doing C++, I could read the value of a custom option using <code>string value = MyMessage::descriptor()-&gt;options().GetExtension(my_option);</code>. There are similar examples for Java and Python. But I'm doing C# and I could find an equivalent. Can I do it, and if yes, how?</p>
  
  <p><strong>More details</strong></p>
  
  <p>I'm manipulating classes generated with <a href="https://www.nuget.org/packages/Google.Protobuf.Tools/" rel="noreferrer">protobuf3</a>. The schemas are declaring a <a href="https://developers.google.com/protocol-buffers/docs/proto#customoptions" rel="noreferrer">custom option</a>. It looks like this:</p>
  
  <pre><code>import "google/protobuf/descriptor.proto";
  
  extend google.protobuf.MessageOptions {
    string my_option = 51234;
  }
  
  message MyMessage {
    option (my_option) = "Hello world!";
  }
  </code></pre>
  
  <p>My code is being provided an object generated from <code>MyMessage</code>, and I'd like to read the value of this option (here <code>Hello world!</code>)</p>
  
  <hr>
  
  <p>Update: I'm not using protobuf-net. Now that C# is natively supported by protobuf, I'm using Google's protobuf3 C# library.</p>