Results 1 to 2 of 2

Thread: Deserialization problems[resolved]

Threaded View

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    Deserialization problems[resolved]

    Hi there.
    I had this issue before but was resolved adding extra types, and I was serializing an ArrayList than a Generic list type LIST<T>

    Everytime I try to deserialize I get the error:

    "<Bookmark xmlns=''> was not expected."

    It serializes correctly. What am I doing wrong?

    deserialization:

    Code:
     Bookmark[] theBookmarkObject = new Bookmark[] { };
                XmlSerializer theXmlDeserializer = new XmlSerializer(typeof(Bookmark[]));
    
                try
                {
                    if (File.Exists(Environment.CurrentDirectory + @"\" + theSerializedBookmarksFilename))
                    {
                        using (StreamReader theSerializerReader = new StreamReader(Environment.CurrentDirectory + @"\" + theSerializedBookmarksFilename))
                        {
                            theBookmarkObject = (Bookmark[])theXmlDeserializer.Deserialize(theSerializerReader); //here
                        }
                    }
    
                    return theBookmarkObject;
                }
    ....
    Last edited by Techno; Jul 30th, 2006 at 03:50 PM.

    MVP 2007-2010 any chance of a regain?
    Professional Software Developer and Infrastructure Engineer.

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