Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / CLR / September 2003

Tip: Looking for answers? Try searching our database.

Deserialization "cannot find the assembly" when hosting exe from own loader

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Vadim Berman - 06 Sep 2003 02:35 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.