CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Threaded View

  1. #1
    Join Date
    Jun 2011
    Posts
    4

    Deserialize - class has moved from assamby A to assambly B

    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

    Code:
    BinaryFormatter formatter = new BinaryFormatter();
    StayedClass Stayed = null;
    Stayed= (StayedClass)formatter.Deserialize(stream);
    Code:
    public StayedClass(SerializationInfo info, StreamingContext ctxt)
    {
         Moved = (MovedClass)info.GetValue("WebInfo", typeof(MovedClass)); // here it throws a exception
    }
    The exception says:
    Code:
    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?
    Last edited by Gener4tor; March 4th, 2014 at 01:06 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured