[Mono-list] Using other Assemblies at Run time

Jaroslaw Kowalski jaak@zd.com.pl
Sun, 2 Nov 2003 01:21:28 +0100


This is taken from MSDN library:

<configuration>
   <runtime>
      <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
         <probing privatePath="bin;bin2\subbin;bin3"/>
      </assemblyBinding>
   </runtime>
</configuration>

You simply put it into yourapp.exe.config and it just works. No need to do
anything special to read the config file. It gets read automatically when
CLR loads the application.

BTW. The above doesn't have to apply to Mono - I haven't tried it. It works
on MS CLR.

Jarek

----- Original Message ----- 
From: "Met @ Uber" <met@uberstats.com>
To: "Mono-List" <mono-list@ximian.com>
Cc: "Jaroslaw Kowalski" <jaak@zd.com.pl>
Sent: Saturday, November 01, 2003 10:24 PM
Subject: Re: [Mono-list] Using other Assemblies at Run time


> How do I tell the CLR where to look for assemblies?  Also, do you know
> what to use in order to read the *.exe.config file?
>
> thanks a lot,
>
> ~ Matthew
>
> On Sat, 2003-11-01 at 15:47, Jaroslaw Kowalski wrote:
> > Normally you put all your assemblies (exe and dlls) in the same
directory or
> > a subdirectory of the directory where the exe is located. These + GAC
are
> > the only places where assembly loader looks for assemblies.
> >
> > Most .NET apps that I've used (NAnt, NUnit, SharpReader, FXCop) place
all
> > *.exes and *.directories in a application root directory or a bin
directory.
> >
> > You have either:
> >
> > ROOT/bin/Application.exe
> > ROOT/bin/Library1.dll
> > ...
> > ROOT/bin/LibraryN.dll
> > ROOT/somedata/data1.file
> > ROOT/somedata/data2.file
> > ROOT/somedata/data3.file
> >
> > or
> >
> > ROOT/Application.exe
> > ROOT/Library1.dll
> > ...
> > ROOT/LibraryN.dll
> > ROOT/somedata/data1.file
> > ROOT/somedata/data2.file
> > ROOT/somedata/data3.file.
> >
> > Sometimes you may see:
> >
> > ROOT/Application.exe
> > ROOT/libraries/Library1.dll
> > ...
> > ROOT/libraries/LibraryN.dll
> > ROOT/somedata/data1.file
> > ROOT/somedata/data2.file
> > ROOT/somedata/data3.file
> >
> > but this requires you to provide a config file for the *.exe to tell the
CLR
> > where to locate assemblies.
> >
> > Jarek
> > ----- Original Message ----- 
> > From: "Met @ Uber" <met@uberstats.com>
> > To: "Mono-List" <mono-list@ximian.com>
> > Sent: Saturday, November 01, 2003 7:56 PM
> > Subject: [Mono-list] Using other Assemblies at Run time
> >
> >
> > > I'm writing an application that uses assemblies like log4net which do
> > > not belong with the rest for many reasons.  As such, I'm trying to
> > > figure out where it belongs.  If this were Java I'd create a lib
> > > directory to hold the Jars in the same directory as the EXE, but this
> > > isn't Java ;-)
> > >
> > > So basically, where do I put assemblies I need to be distributed with
my
> > > application?  I do not want them in the main directory, for neatness,
> > > separation, etc.
> > >
> > > Thanks in advance,
> > >
> > > ~ Matthew
> > >
> > > _______________________________________________
> > > Mono-list maillist  -  Mono-list@lists.ximian.com
> > > http://lists.ximian.com/mailman/listinfo/mono-list
> > >
> >
>