Open GoogleCodeExporter opened 9 years ago
Can you clarify what you did in step 2, and what exactly person.protobin
contains? I am unclear whether this is:
- a .proto schema file (text), renamed
- a .proto schema file (binary, via protoc)
- protobuf data, as produced from Serialize
if it is the 3rd, that is not the intended usage; by that point you *already
have* classes (you must have, to have generated a file). The protogen tool is
intended for use with schema files, but it is not *necessary* to do this to use
protobuf-net
Original comment by marc.gravell
on 10 Nov 2010 at 10:05
Hi marc,
In "step 2" I prepared sample (see attached .cs files) and run it.
As result of the running sample, a binary file "person.protobin" was created.
So, file person.protobin contains binary serialization data.
Now I understand, protogen works with schema file (not binary serialization).
Can I convert binary file to a text file?
Could you add to "Getting Started" page relevant schema for the published
sample.
I am beginner in "protobuf" and, to understand the thing, I want to link "new
protobuf domain" with known "xml domain".
I guess, if "Getting Started" will be expanded, it will help to us to
investigate the technology and, probably, to start use it in our projects.
Thank you,
Igor.
Original comment by igor.zc
on 11 Nov 2010 at 12:19
Attachments:
Protobuf-net is inherently a binary serializer, not a text serializer. There
*is* an alternative text format associated with the protocol, but this is
rarely used so is not provided here (you lose most of the benefits). However,
it is almost always possible (very easily) to use protobuf-net and
XmlSerializer against the exact same class model.
Here is an example of such a model:
http://stackoverflow.com/questions/4143421/4143614#4143614
If you need to retain your existing xml attributes (in particular for
[XmlAttribute]) then simply use [ProtoContract]/[ProtoMember(n)] to describe
the protobuf behaviour, retaining [XmlType],[XmlElement],[XmlAttribute] etc for
XmlSerializer's use.
Original comment by marc.gravell
on 11 Nov 2010 at 1:37
Thank you.
Igor.
Original comment by igor.zc
on 11 Nov 2010 at 2:48
Original issue reported on code.google.com by
igor.zc
on 10 Nov 2010 at 3:12