0

I have some class, for example:

Public Class MyClass
  Public Property MyProperty As Integer = 1
End Class

Serializer (Xml.Serialization.XmlSerializer) creates XML:

<?xml version="1.0" encoding="utf-8"?>
<MyClass xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <MyProperty>1</MyProperty>
</MyClass>

How I can get from serializer somthing like this:

<?xml version="1.0" encoding="utf-8"?> <MyClass xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <!-- Use positive values less than 10 -->
    <MyProperty>1</MyProperty>
 </MyClass>

Thanks!

Bogdan Samchuk
  • 138
  • 1
  • 9
  • 4
    Look at [this SO Question](http://stackoverflow.com/questions/7385921/how-to-write-a-comment-to-an-xml-file-when-using-the-xmlserializer) – Icemanind Apr 19 '16 at 21:15

1 Answers1

0

Try to make use of [XmlComment(Value = "Your Comment")] attribute

Maddy
  • 774
  • 5
  • 14