This project has moved and is read-only. For the latest updates, please go here.

How to deserialize WeakReference ?

Jan 12, 2010 at 7: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.




Jan 12, 2010 at 10:06 PM

No it doesn't. It has 3.

Jan 12, 2010 at 10:24 PM

I see, 

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

Is there any other way to do it?



Jan 12, 2010 at 11:40 PM

I think a custom converter would be the best option.