[Mono-list] BinaryFormatter, Deserialize(), casting throws exception.

Robert Jordan robertj at gmx.net
Tue Aug 29 05:05:40 EDT 2006

Wiktor Grębla wrote:
> Robert Jordan napisał(a):
>> Because the deserialized data is not of type "Mydata".
>> What's the output of
>> Console.WriteLine (bf.Deserialize(fs).GetType ().FullName)
> Mydata (unfortunately).

It could be another version of Mydata.


Console.WriteLine (bf.Deserialize(fs).GetType ().Assembly.FullName)


Console.WriteLine (typeof (Mydata).Assembly.FullName)

BTW, try to get a *full* stack trace using

try {
	your code
} catch (Exception ex) {
	Console.WriteLine (ex);


More information about the Mono-list mailing list