How to deserialize WeakReference ?

Jan 12, 2010 at 6:07 PM

I try to serialize and deserialize a WeakReference property,

but I got exception: "Unable to find a constructor to use for type System.WeakReference. A class should either have a default constructor or only one constructor with arguments.", 

Why? WeakReference did have a single paramatized constructor.

 

 

 

Coordinator
Jan 12, 2010 at 9:06 PM

No it doesn't. It has 3.

Jan 12, 2010 at 9:24 PM

I see, 

But how do I deserialize a WeakReference property? Custom converter?

Is there any other way to do it?

 

Thanks.

Coordinator
Jan 12, 2010 at 10:40 PM

I think a custom converter would be the best option.