I use the simple loader that hosts the managed application (I need this to
load the "svr" version on a server). I use the code suggested by Steven
Pratschner [MS] in news article
http://groups.google.com/groups?selm=%23nx5kl9HDHA.2256%40TK2MSFTNGP11.phx.gbl.
The problem is, I cannot now deserialize data that I serialized by the same
application. Here is how I serialize and deserialize them:
Serialization:
stream = new FileStream(descrPath, FileMode.Create);
BinaryFormatter formatter = new BinaryFormatter();
formatter.AssemblyFormat = Formatters.FormatterAssemblyStyle.Simple;
formatter.Serialize(stream, fd);
Deserialization:
stream = new FileStream(name, FileMode.Open);
BinaryFormatter formatter = new BinaryFormatter();
formatter.AssemblyFormat = Formatters.FormatterAssemblyStyle.Simple;
object obj = formatter.Deserialize(stream);
fd = (FileDescr)obj;
This works if I start the managed file directly. But when I host the same
application from my loader, on Deserialize I have an exception with message
that says "Cannot find the assembly <myName>" where <myName> is the proper
name of my assembly (I actually checked that
AppDomain.CurrentDomain.GetAssemblies() includes this assembly).
Anyone can explain me what is wrong here?
Thanks,
Vadim
Vadim Berman - 10 Sep 2003 00:43 GMT
If anyone wants to know the solution, the problem was solved by moving the
loader exe to the same directory as the .NET exes and dlls.
Vadim
> I use the simple loader that hosts the managed application (I need this to
> load the "svr" version on a server). I use the code suggested by Steven
> Pratschner [MS] in news article
http://groups.google.com/groups?selm=%23nx5kl9HDHA.2256%40TK2MSFTNGP11.phx.gbl.
> The problem is, I cannot now deserialize data that I serialized by the same
> application. Here is how I serialize and deserialize them:
[quoted text clipped - 23 lines]
>
> Vadim