I am not sure the appropriate newsgroup for this question,...I have also posted this on the XML.SOAP foru
Within a VB.NET application, I have two objects that are serializable. The second object contains a string variable containing the SOAP Serialized XML of the first object. If I serialize the second object into a string, I get very strange results with the string. I am certain there is a bug somewhere in the .NET framework causing this. Below is sample VB code that illustrated the problem using hashtables. Run the code, and note the message in the messagebox. Then uncomment the one line commented out and again look at the message box. You will see the text concatenated after the serialized string is missing
Thanks, and please let me know if I need to provide further clarification on the issue or if there is a more appropriate newsgroup to post this
Code
Dim formatter As New System.Runtime.Serialization.Formatters.Soap.SoapF ormatte
Dim ms As New System.IO.MemoryStrea
Dim x, thisOtherClassString, SeralizedObject As Strin
Dim thisOtherClass As New Hashtabl
Dim thisClass As New Hashtabl
thisOtherClass.Add("AA", "DD"
thisOtherClass.Add("AX", "ED"
thisOtherClass.Add("UU", "FF"
formatter.Serialize(ms, thisOtherClass
thisOtherClassString = System.Text.Encoding.ASCII.GetString(ms.GetBuffer( )
thisClass.Add("CX", "CXZ"
'thisClass.Add(thisOtherClassString, "test") '<---uncomment this line and again look at the messagebox result
thisClass.Add("CX2", "CXZ2"
thisClass.Add("CX3", "CXZ3"
ms = New System.IO.MemoryStrea
formatter.Serialize(ms, thisClass
SeralizedObject = System.Text.Encoding.ASCII.GetString(ms.GetBuffer( )
x = "this is before the string " & SeralizedObject.Trim & " this is after the string
MessageBox.Show(x) '<---note the exact text returne