0

Possible Duplicate:
Reading XML comments in C#

Is there a way in C# to write read in an XML file with comments and write those comments back out with the modified XML file?

I am using and XmlSerializer to deaserialize it. Then I am casting it to a class that was generated from an XSD using xsd.

Community
  • 1
  • 1
icirellik
  • 746
  • 6
  • 21

1 Answers1

2

Yes, comments are not automatically removed.

You will have to make an effort not to write them out.

So you can use XDocument, XmlDocument or XmlReader/XmlWriter.

H H
  • 263,252
  • 30
  • 330
  • 514