XML Deserializing Line Feeds

D

dk9

I've serialize an object like this:

Dim MyName As String = "testing" & vbNewLine & "serialization"
Dim Formatter As New Xml.Serialization.XmlSerializer(MyName)

Try
Dim fs As New FileStream(_FilePath, FileMode.Create)
Formatter.Serialize(fs, MyName)
fs.Close()
Catch ex As Exception

End Try



The created XML file is well writen, there's a line feed there.
But when I'm deserializing the object, the line just dissapears...
It returns "testingserialization"


Dim Formatter As New
Xml.Serialization.XmlSerializer(GetType(String))

Try
Dim fs As New FileStream(_FilePath, FileMode.Create)
Formatter.Serialize(fs, MyName)
fs.Close()
Catch ex As Exception

End Try


What's going on here?!??!?!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top