No map for object

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Steve

    #1

    No map for object

    Hello all,
    I have some code:

    Public Shared Function DeserializeMess age(ByVal stream As Byte(), ByRef obj
    As Object) As Boolean

    Try
    Dim ms As MemoryStream = New MemoryStream(st ream)
    Dim bf As BinaryFormatter = New BinaryFormatter
    ms.Position = 0
    bf.Binder = New MessageBinder
    bf.Binder.BindT oType([Assembly].GetExecutingAs sembly().FullNa me,
    "AlertMessa ge")
    obj = bf.Deserialize( ms)
    Return True
    Catch exp As System.Runtime. Serialization.S erializationExc eption
    Debug.WriteLine (String.Format( "Exception in DeserializeMess age, {0}",
    exp.ToString))
    Return False
    End Try
    End Function

    When I attempt to deserialize (obj = bf.Deserialize( ms), I receive the
    No map for object 201326592
    error. How can I determine what object this is? I suspect it is the
    AlertMessage, which is a class of my own design. What can I do to resolve
    this error?

    Thanks,
    Steven


Working...