"Alan Shi [MSFT]" <alanshiONLINE@online.microsoft.com> wrote in message
news:eS1k1cFaDHA.2960@tk2msftngp13.phx.gbl...
> Actually, this is not quite true. LoadFrom will give you the assembly you
> specify (even if it is found in the GAC, or other locations), however, you
> cannot load two assemblies with the same identity via LoadFrom in the same
> domain. For example, say 'myassembly' is a strongly-named assembly and I
> deploy it to two locations, c:\first-location, and c:\second-location.
> Assume your appbase is c:\appbase. Issuing:
>
> Assembly.Load("c:\first-location\myassembly.dll")
> Assembly.Load("c:\second-location\myassembly.dll")
>
> ...will cause myassembly to only be loaded from c:\first-location.
>
> The behaviour you are referring to (e.g. if you LoadFrom an assembly, and
> the same assembly, from the same location would have been found via
> probing), only determines which load context the assembly gets put in.
>
> As you mention, LoadFile is a potential workaround.
>
> .\lan
>
> --
> This posting is provided "AS IS" with no warranties, and confers no
rights.
>
http://blogs.gotdotnet.com/alanshi >
>
> "Peter Allwin [MSFT]" <peterall@online.microsoft.com> wrote in message
> news:OUEHPpEaDHA.1816@TK2MSFTNGP09.phx.gbl...
> > Sean,
> >
> > It sounds to me like the wrong assembly gets loaded. Assembly.LoadFrom
> does
> > not gurantee the assembly you load will be the same one you specified.
> > Basically it extracts the assembly info from the assembly you specified,
> and
> > it will return the assembly you specified only if it cannot find any
> > assembly with the same assembly info from high priority places (like the
> > GAC).
> >
> > If you are using version 1.1 of the Framework (VS 2003) you can use
> > Assembly.LoadFile which circumvents this behavior.
> >
> >
> > Best Regards,
> >
> > Peter Allwin
> >
> >
> > This posting is provided "AS IS" with no warranties, and confers no
> rights.
> >
> >
> > "Sean Winstead" <sean_at_componentscience_dot_net> wrote in message
> > news:1p3akv8v4ouqiji88mql95vod7d1l0ku9v@4ax.com...
> > > When I load an assembly using
> > > Assembly.LoadFrom("C:\temp\sumdumAssembly.dll"), the assembly is
> > > loaded and its FullName property identifies it as the correct
> > > assembly. However, the Location and CodeBase properties point to the
> > > assembly that called Assembly.LoadFrom.
> > >
> > > I have read the article titled "Application Isolation and
> > > Assembly.LoadFrom" but it did not appear to address this issue.
> > >
> > > Does anyone know why the aforementioned behavior occurs?
> > >
> > > --
> > > Sean Winstead
> > >
http://www.componentscience.net > >
> >
>
>