I answered this where you cross-posted on stackoverflow:
http://stackoverflow.com/questions/7717036/serialize-protocol-buffer-file-into-xml-text-format

To repeat; in most cases, the generated code **should already** work
perfectly well with XmlSerailizer (the inbuilt .NET xml serialization tool),
so you shouldn't have to do *anything*. If you want to add helper methods
for this to your type, then note that the files are generated as "partial
classes", which means you can add additional code files for the same
classes, and the compiler will combine them.

If I *still* haven't answered your question, maybe provide a small sample of
what you are trying to achieve.

Marc


On 10 October 2011 05:06, henry <chen...@gmail.com> wrote:

> I am using protocol buffer in .net http://code.google.com/p/protobuf-net/.
>
> I installed the visual studio support version, which I can just write
> proto file in project and it generates csharp class files
> automatically.
>
> A lot of times that I need to dump the files into xml(or another text
> format if available) file. I found that there is a method
> Serializer.Serialize() which takes an XmlWriter parameter. I tried to
> use it but it complains that the protobuf type I defined must be
> convertible to System.Xml.Serialization.IXmlSerializable.
>
> In my case, what I should do in order for my type can be convertible
> to System.Xml.Serialization.IXmlSerializable? I don't want to change
> the cs file directly since it is generated on the fly when the proto
> file is changed.
>
> thanks.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To post to this group, send email to protobuf@googlegroups.com.
> To unsubscribe from this group, send email to
> protobuf+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/protobuf?hl=en.
>
>


-- 
Regards,

Marc

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.

Reply via email to