Results 1 to 3 of 3

Thread: constructor to deserialize object not found [Resolved]

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jun 1999
    Location
    California, USA
    Posts
    662

    Resolved constructor to deserialize object not found [Resolved]

    any idea of what the following exception actualy means? I mean in usable programmer speak? All of the classes to be serialized have regular constructors. Is there some sort of special constructor for deserializing that I eveidently don't know about? I've been working on this UserDB set of classes for quite a bit longer than I wanted to and vbforums.com search doesn't find very much when I copy + paste "The constructor to deserialize an object of type was not found"

    An unhandled exception of type 'System.Runtime.Serialization.SerializationException' occurred in mscorlib.dll

    Additional information: The constructor to deserialize an object of type GenericChatServer.Users was not found.
    It's also bugging me that pressing F1 no longer brings you to a help page with a useful description of the exeception. Now, it brings me to a help page describing the intricate workings of the exception dialog which contains no more than four buttons...

    As you can probably tell, I'm a bit pissed.
    Last edited by agent; Nov 30th, 2004 at 11:55 PM.

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Do all dependent or child objects of that object have parameterless constructors?

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Jun 1999
    Location
    California, USA
    Posts
    662
    resolved it

    ok... though it's not in the documentation as far as I could find, if the class inherits Hashtable, you need to include
    VB Code:
    1. Protected Sub New(ByVal info As Runtime.Serialization.SerializationInfo, ByVal context As Runtime.Serialization.StreamingContext)
    2.         MyBase.New(info, context)
    3.     End Sub

    If the class uses no constructor, you'll need to add a blank one.

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