user defined reference directory

  • Thread starter Thread starter Rene Sørensen
  • Start date Start date
R

Rene Sørensen

Is there a way to decide where all my class libraries (dlls) are
located instead of just having them in the same directory as the main
application? What I'm thinking is to have a directory structure like
this
"c:\program files\app\system\" for dlls
"c:\program files\app\app.exe" my application file
"c:\program files\app\plugins\" my plugins
How do I tell my exe and plug-ins to look for the reference in another
directory?
 
Rene said:
Is there a way to decide where all my class libraries (dlls) are
located instead of just having them in the same directory as the main
application? What I'm thinking is to have a directory structure like
this
"c:\program files\app\system\" for dlls
"c:\program files\app\app.exe" my application file
"c:\program files\app\plugins\" my plugins
How do I tell my exe and plug-ins to look for the reference in another
directory?

PATH ? GAC ?

Arne
 
The runtime doesn't access the PATH variable at all when loading
assemblies.

The GAC isn't what is desired here, since the OP wants private sub
directories to search for assemblies in.

The best option is to use the <probing> element in the app config file.
 
Thanks for the quick response this was very helpfully.
I have another question, can I use <probling> when I need a reference
from a "c:\program files\app\plugins\" to a dll located in "c:\program
files\app\system\". I should maybe say here that my plug-ins is dlls
 
Rene,

As long as your app resides in "c:\program files\app" and you list
plugins and system in the probing element, your assemblies should be able to
resolve references correctly.
 
Nicholas Paldino

Thanks for your help, you solved my problem. In my appConfig i just
needed to have multiple defines, so now it looks like this
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="system\;plugins\"/>
</assemblyBinding>
</runtime>
 
Back
Top