Hello,
I'm tryng to serialize an object to XML by using C# with the following code:
memoryStream = new System.IO.MemoryStream();
Serializer.Serialize(memoryStream, this);
memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
streamReader = new System.IO.StreamReader(memoryStream);
return streamReader.ReadToEnd();
My problem is that this produce the following output in the part of the document:
<?xml version="1.0"?>
And I want to have the following:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
Does anybody know how to include both the "encoding" and "standalone" attribute?
I saw this, but it seems that is not producing the output I need.
Thanks!