I’m attempting to deserialize an object and when I click ‘step into’ on this first line of code, I get returned to the form as if I clicked continue. The If Else statements never execute.
c = CType(x.Deserialize(mobjClient.GetStream), Cereal)
If c.text.Length > 0 Then
RaiseEvent LineReceived(Me, c.text)
Else
RaiseEvent CardReceived(Me, c)
End If
here is the code that precludes that
Dim x As New XmlSerializer(GetType(Cereal))
Dim c As New Cereal
Stepping through the serializing code from the client side seems to work fine. Here is my Cereal class in case you all need it. mobjClient.getStream is a TcpClient Stream.
<Serializable> Public Class Cereal
Public id As Integer
Public cardType As Type
Public attacker As String
Public defender As String
Public placedOn As String
Public attack As Boolean
Public placed As Boolean
Public played As Boolean
Public text As String
Public Sub New()
End Sub
End Class
This is how I fixed it….. Finally figured out how to correctly serialize and deserialize data.
and here is the deserialization…