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.
> When I load an assembly using
> Assembly.LoadFrom("C:\temp\sumdumAssembly.dll"), the assembly is
[quoted text clipped - 10 lines]
> Sean Winstead
> http://www.componentscience.net
Alan Shi [MSFT] - 22 Aug 2003 03:43 GMT
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

Signature
This posting is provided "AS IS" with no warranties, and confers no rights.
http://blogs.gotdotnet.com/alanshi
> Sean,
>
[quoted text clipped - 28 lines]
> > Sean Winstead
> > http://www.componentscience.net
Peter Allwin [MSFT] - 22 Aug 2003 04:43 GMT
Thanks for clarifying :)

Signature
Best Regards,
Peter Allwin
This posting is provided "AS IS" with no warranties, and confers no rights.
> 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
[quoted text clipped - 51 lines]
> > > Sean Winstead
> > > http://www.componentscience.net
Sean Winstead - 23 Aug 2003 03:49 GMT
>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.
Thanks to you and Alan for the information. I'm pretty sure it has the
correct assembly. I say this because once the assembly is loaded, the
code reflects through the assembly's types and it does find the
correct types. We have tested this on at least one clean machine and
the same behavior occurs.
My workaround was simple. The only reason I needed things like
Location and CodeBase is because I needed to get the loaded assembly's
AssemblyName. I was able to get the AssemblyName via another route.
--
Sean Winstead
http://www.componentscience.net