title: Serialize a protoBuf-net message to a stream c# - getting error "Only data-contract classes can be processed"
body: <p>I have a message in protoBuf which called "package", I generated my .proto file to classes in purpose to fill all the required fields in that "package" and it works fine.
  Now, I have that protoBuf message instance called "package" and I want to serialize it to a stream and then output it to a file.</p>
  
  <pre><code>                    byte[] data;
                      using (var ms = new MemoryStream())
                      {
                          Serializer.Serialize&lt;repo_package.Package.Builder&gt;(ms, package);
                          data = ms.ToArray();
                      }
                      string packageFilePath = Path.Combine("C:\\1", package.Name);
                      File.WriteAllBytes(packageFilePath, data);
  </code></pre>
  
  <p>The problem is the I'm getting an Error when I calling to "Serializer" function, the error is</p>
  
  <p>"Only data-contract classes (and lists/arrays of such) can be processed"</p>
  
  <p>Why is that?
  How I can output my Package (protobuf message) to a file?</p>
  
  <p>Thank you,</p>
  
  <p>Orion.</p>