Your LoadFrom loaded the assembly into the "LoadFrom binding context".  When
the object is received over remoting, the remoting infrastructure does the
equivalent of Assembly.Load("AssemblyName"), which only searches the "Load
binding context".  The two binding contexts are kept isolated intentionally
as described in the article Keith mentioned
(http://www.gotdotnet.com/team/clr/LoadFromIsolation.aspx).

I'm not sure if its always the best approach, but I have found it necessary
to sometimes circumvent this isolation by using my own assembly resolver.
I.e. hook the AppDomain.AssemblyResolve event to return a reference to the
assembly loaded into the LoadFrom binding context when necessary.

Rick

----- Original Message -----
From: "Andy Smith" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 12, 2004 1:55 PM
Subject: Re: Problem Using LoadFrom()


> But what did the LoadFrom() call do then, exactly? If my host actually
> loaded the DLL at startup why is it looking for the file again when a
client
> actually makes a call?
>
> Thanks.
>
> Andy
>
>
> -----Original Message-----
> From: Moderated discussion of advanced .NET topics.
> [mailto:[EMAIL PROTECTED] On Behalf Of Gautama, Damon
> Sent: Monday, January 12, 2004 12:39 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [ADVANCED-DOTNET] Problem Using LoadFrom()
>
> Is your assembly strong named? If not, I think this is expected behavior.
>
> damon
>
> -----Original Message-----
> From: Andy Smith [mailto:[EMAIL PROTECTED]
> Sent: Monday, January 12, 2004 10:59 AM
> To: [EMAIL PROTECTED]
> Subject: [ADVANCED-DOTNET] Problem Using LoadFrom()
>
>
> I use LoadFrom() to load an assembly and register the remotable types
> included therein. I make a call to one of these remotable types from a
> remote client and it fails UNLESS I put the assembly in the same directory
> as the host (executable). It's as if the path that was provided for the
> LoadFrom() is ignored by the host when it comes time to actually service a
> remoting call. But this seems odd, doesn't the assembly stay loaded after
my
> LoadFrom() call? Why would it have to look for the DLL file, since I
already
> loaded it? I must be missing something...
>
> Thanks!
>
> Andy
>
> ===================================
> This list is hosted by DevelopMentor(r)  http://www.develop.com Some .NET
> courses you may be interested in:
>
> NEW! Guerrilla ASP.NET, 26 Jan 2004, in Los Angeles
> http://www.develop.com/courses/gaspdotnetls
>
> View archives and manage your subscription(s) at
http://discuss.develop.com
>
> ===================================
> This list is hosted by DevelopMentor(r)  http://www.develop.com Some .NET
> courses you may be interested in:
>
> NEW! Guerrilla ASP.NET, 26 Jan 2004, in Los Angeles
> http://www.develop.com/courses/gaspdotnetls
>
> View archives and manage your subscription(s) at
http://discuss.develop.com
>
> ===================================
> This list is hosted by DevelopMentor�  http://www.develop.com
> Some .NET courses you may be interested in:
>
> NEW! Guerrilla ASP.NET, 26 Jan 2004, in Los Angeles
> http://www.develop.com/courses/gaspdotnetls
>
> View archives and manage your subscription(s) at
http://discuss.develop.com
>

===================================
This list is hosted by DevelopMentor�  http://www.develop.com
Some .NET courses you may be interested in:

NEW! Guerrilla ASP.NET, 26 Jan 2004, in Los Angeles
http://www.develop.com/courses/gaspdotnetls

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to