[Mono-list] Loading assemblies from a different places

Sermus andrey.v.filimonov at gmail.com
Thu Apr 7 06:01:37 EDT 2011


Hello,
I have a .net application which has to load assemblies. The trick is that it
has to load the same assembly from different directories (please don't ask
me why i need this, this is a 3rd party requirement). So, imagine i have an
assembly named assembly.dll. It's placed in different places like:
dir1/assembly.dll
dir2/assembly.dll
dir3/assembly.dll
...

The application goes through the directories trying to load assemblies. The
code looks like:
foreach (string assemblypath in paths)
{
      Assembly assembly = Assembly.LoadFrom(assemblypath); 
      //here i'm getting types from this assembly
}

With CLR this piece of code executed just as expected, i.e. it returns me
references to the projection of dir1/assembly.dll during the first
iteration, to the dir2/assembly.dll during the second one, etc.

With Mono 2.6.7 it behaves differently. It always returns reference to
dir1/assembly.dll whatever path i pass to LoadFrom(). I suppose this is
because Mono detects that the assemblies are really the same (BTW how?) and
after loading the first one it doesn't attempt to load the rest of them.

Is there anyway to force Mono to do exactly what i instruct it to do, namely
load the assemblies i want to load from the directory i want them to be
loaded from.

--
View this message in context: http://mono.1490590.n4.nabble.com/Loading-assemblies-from-a-different-places-tp3432917p3432917.html
Sent from the Mono - General mailing list archive at Nabble.com.


More information about the Mono-list mailing list