title: Unable to load type ObjectSerialization. Serial required for deserialization
body: <p>I am trying to serialize a class and then de-serialize it to a second class, to imitate future additions to the structure of the class, so I am attempting to Imlpement ISerializable</p>
  
  <pre><code>Imports System.IO
  Imports System.Runtime.Serialization
  Imports System.Runtime.Serialization.Formatters.Binary
  
  &lt;Serializable()&gt; _
  Public Class Serial
      Implements ISerializable
  
  
      Public Num1 As Integer
      Public Num2 As Integer
  
      Protected Sub New(ByVal Info As SerializationInfo, ByVal Context As StreamingContext)
          With Info
              Num1 = .GetInt32("Num1")
              Num2 = .GetInt32("Num2")
  
          End With
      End Sub
  
      Public Sub GetObjectData(info As System.Runtime.Serialization.SerializationInfo, context As System.Runtime.Serialization.StreamingContext) Implements System.Runtime.Serialization.ISerializable.GetObjectData
  
          With info
              .FullTypeName = "ObjectSerialization. Serial"
              .AddValue("Num1", Num1)
              .AddValue("Num2", Num2)
          End With
      End Sub
  End Class
  
  &lt;Serializable()&gt; _
  Public Class Serial2
      Implements ISerializable
  
  
      Public Num1 As Integer
      Public Num2 As Integer
      Public Num3 As Integer
  
      Protected Sub New(ByVal Info As SerializationInfo, ByVal Context As StreamingContext)
          With Info
              Num1 = .GetInt32("Num1")
              Num2 = .GetInt32("Num2")
              Num3 = .GetInt32("Num3")
          End With
      End Sub
  
  
      Public Sub GetObjectData(info As System.Runtime.Serialization.SerializationInfo, context As System.Runtime.Serialization.StreamingContext) Implements System.Runtime.Serialization.ISerializable.GetObjectData
  
          With info
              .FullTypeName = "ObjectSerialization. Serial"
              .AddValue("Num1", Num1)
              .AddValue("Num2", Num2)
              .AddValue("Num3", Num3)
          End With
      End Sub
  End Class
  </code></pre>
  
  <p>An exception occurs (Unable to load type ObjectSerialization. Serial required for deserialization) when I attempt to deserialize in the code below. Can someone point me in the right direction.</p>
  
  <pre><code>Dim s1 As New Serial
  Dim s2 As New Serial2
  s1.Num1 = 99
  s1.Num2 = 500
  
  Dim fs As New FileStream("DataFile.dat", FileMode.Create)
  Dim formatter As New BinaryFormatter
  Try
      formatter.Serialize(fs, s1)
  Catch ex As SerializationException
      Console.WriteLine("Failed to serialize. Reason: " &amp; ex.Message)
  Finally
      fs.Close()
  End Try
  
  fs = New FileStream("DataFile.dat", FileMode.Open)
  Try
      formatter = New BinaryFormatter
  
      s2 = formatter.Deserialize(fs)
  Catch ex As SerializationException
  
      Console.WriteLine("Failed to deserialize. Reason: " &amp; ex.Message)
      Throw
  Finally
      fs.Close()
  End Try
  
  End Sub
  </code></pre>