IIRC, there is a requirement for a default parameterless public contructor
on the serializable class, in order for the Soap Formatter to serialize it,
but I may be incorrect. I haven't looked at Treenode; and have you tried
:base()? (or the VB analog?)
Steve Holak
Senior Software Architect
Brokerage Concepts IS Dept.
610-491-4879
email: [EMAIL PROTECTED]
Christoph
<ChristophDotNet@AUST To: [EMAIL PROTECTED]
IN.RR.COM> cc:
Sent by: dotnet Subject: Re: [DOTNET] Object
serialization to string representation
discussion
<[EMAIL PROTECTED]
OP.COM>
05/21/2002 01:46 PM
Please respond to
dotnet discussion
This usually means that your class implements the ISerializable interface,
but does not implement the required constructor of the format.
Here's from the Framework docs:
The ISerializable interface implies a constructor with the signature
Constructor(SerializationInfo info, StreamingContext context). At
deserialization time, the current constructor is called only after the data
in the SerializationInfo has been deserialized by the formatter. In general
this constructor should be protected if the class is not sealed
(NotInheritable in Visual Basic) .
I couldn't tell that this is the case from your code samples ...
HTH,
Christoph Schittko
Software Architect
Mshow - a division of InterCall
----- Original Message -----
From: "franklin gray" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, May 21, 2002 12:25 PM
Subject: Re: [DOTNET] Object serialization to string representation
Any idea what this means?
An unhandled exception of type
'System.Runtime.Serialization.SerializationException' occurred in
mscorlib.dll
Additional information: The constructor to deserialize an object of type
SoapSerialization.Class2 was not found.
I tried it 3 ways with an error but the 4th works.
<Serializable()> Public Class Class2
Inherits TreeNode
Public Sub New()
MyBase.New("Blank")
End Sub
Public MyData As String
End Class
<Serializable()> Public Class Class2
Inherits TreeNode
Public Sub New()
End Sub
Public MyData As String
End Class
<Serializable()> Public Class Class2
Inherits TreeNode
Public MyData As String
End Class
This works though
<Serializable()> Public Class Class2
Public MyData As String
End Class
You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.
You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.
You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.