R
Ryan.Mohammed
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.
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.