HighTechTalks DotNet Forums  

LoadFrom and unresolved dependencies

Dotnet Framework (CLR) microsoft.public.dotnet.framework.clr


Discuss LoadFrom and unresolved dependencies in the Dotnet Framework (CLR) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Vagif Abilov
 
Posts: n/a

Default LoadFrom and unresolved dependencies - 05-24-2005 , 12:54 PM






Hello,

I have a simple set of assemblies:

Directory A: Assembly "A", references Assembly "Common" (strong identity,
signed, version 1.1)
Directory B: Assembly "B", references Assembly "Common" (strong identity,
signed, version 1.2)

If assembly A tries to load B using LoadFrom, then exception is raised.
However, if I remove a reference to "Common" either from A or B, then A
successfully loads B.

I could understand this behavior if Common did not have strong identity. But
it does! Versions 1.1 and 1.2 _are_ different assemblies, their name
equality should not matter. This is the whole point of having strong
identity.

The only explanation I have is that if you try to load an assembly with
CodeBase (using LoadFrom), then all its dependencies will also be loaded
using LoadFrom thus discarding strong version details. But is this logical?
This is what GotDotNet faqs say:

"Remember too that you can always keep an assemblys identity unique (and
thus avoid both this issue and the one described in the previous section) by
giving it a strong name."

I think this statement contradicts the way Framework resolves dependencies
of CodeBase'd assemblies.

Of course I can add a AssemblyResolve event handler, and it will help. But
isn't it a dirty approach?

Vagif Abilov
Oslo Norway



Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.