Hi,
I have implemented my own formatter (comparable to
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter).
Generally it works quite well, but I ran into an issue with delegates.
Basically, when I try to deserialize a System.Delegate, I get the error:
The constructor to deserialize an object of type
WindowsApplication1.Class2+a was not found
So the problem here, I think, is that the delegate class implements
ISerializable, and MSDN says that if you implement ISerializable, you
are supposed to implement a special constructor
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemruntimeserializationiserializableclasstopic.asp).
As far as I can tell, the System.Delegate class does not implement this
constructor.
So the question is: how am I supposed to deserialize it? Somehow the
BinaryFormatter is able to deserialize it, so there must be a way.
I get the feeling I am missing something fundamental here. Should I be
treating Delegates specially? If so, how?
Also, are there any other classes that don't conform to the normal
serialization standards?
Thanks,
Scott.