469,327 Members | 1,232 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,327 developers. It's quick & easy.

specifying where to look for assembly when executing BinaryFormatter.Deserialize

I have a problem where the code that serializes and deserializes an
object is actually not the start application but loaded by reflection
and located in a subdirectory of the start application.

Example

\
Start.exe
Platforms\Sub\Running.dll

Running.dll serializes an object that is defined in Running.dll using
BinaryFormatter. As an experiment, I deserialize the binary in the same
Running.dll expecting it to recreate my object however it seems to look
in the root directory of the application (where Start.exe exists) and
hence fails to find the Running assembly (an exception is thrown).

As an experiment, if I copy Running.dll to the root directory it
actually deserializes ok to an object but then there are other problems
since I am still in executing in Running.dll and can't cast to an
object that basically has a different type since the deserializer
identified it from another copy of the dll.

Hope this is not too confusing , any help would be appreciated. I think
that all I need to solve is somehow to get the deserilizer to look at
the executing assembly and not try to find another.

Apr 7 '06 #1
1 1573

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Carl Gilbert | last post: by
1 post views Thread by Paul Bawin | last post: by
2 posts views Thread by Henrik Skak Pedersen | last post: by
1 post views Thread by Dejan | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
reply views Thread by listenups61195 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.