deserialization error: unable to find assembly

R

realgeek

Hi. I am writing a class lib that has com interop enabled and it is
housed and used within some other application. So then, I serialize one
of the classes, and on subsequent launches I try to deserealize them.
That's when I get SerializatonException: cannot find the assembly (my
assembly)".


I tried loading the assembly at runtime, but it still won't work;
Howervr, I noticed that the version number in the exception and in the
messagebox produced by this code:

Assembly self = Assembly.LoadFrom(pathToSelf);
MessageBox.Show(self.ToString());
is different. The rightmost value is diffferent (build number I
suppose).
I am sure that the clas definition didn't change between these
versions, but I am wondering;

1) will it work this way (loading self at runtime) if one version of
the assembly is used for both saving and loading?
2) if not, how do I make it work, and is this even possible?
2) if yes, is there a way to make it ignore versions?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top