Reputation: 21
How convert protobuf-net object to xml? I have very big object which is contained in protobuf-net format file. I want visualize all fields and sub-fields of this object in xml format. How to do it?
Upvotes: 1
Views: 649
Reputation: 1063864
Since protobuf-net aims to target idiomatic .net types, most types that work well with protobuf-net will also work fine with XmlSerializer
(and other serializers such as json.net, JIL). So basically: just try XmlSerializer
:
YourRootObject obj = ...
var ser = new XmlSerializer(typeof(YourRootObject));
ser.Serialize(destination, obj);
Upvotes: 1