Question Deserialize - class has moved from assamby A to assambly B

Generator

New member
Joined
Mar 4, 2014
Messages
1
Programming Experience
10+
For various reasons I moved a class (MovedClass) from assamblyA to assamblyB and also changed the namespace it was in. Everything else stayed the same.

But now I have a problem reading the Data I serealized before moving the class

C#:
BinaryFormatter formatter = new BinaryFormatter();
StayedClass Stayed = null;
Stayed= (StayedClass)formatter.Deserialize(stream);
C#:
public StayedClass(SerializationInfo info, StreamingContext ctxt)
{
     Moved = (MovedClass)info.GetValue("WebInfo", typeof(MovedClass)); // here it throws a exception
}
The exception says:
C#:
Ein Objekt muss IConvertible implementieren.

which is german for:

Object must implement IConvertible
What can I do? Its essential for me to move the Classes to the new assamby. Is there any way to tell desearialize that the class has moved?
 
Top Bottom