AppDomain.CurrentDomain.AppendRelativeSearchPath()

Should give you what you want

Regards

Richard Blewett
DevelopMentor

-----Original Message-----
From: Moderated discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] On Behalf Of JD
Sent: 12 December 2003 20:56
To: [EMAIL PROTECTED]
Subject: [ADVANCED-DOTNET] Specify Probing path WITHOUT app.config?

I've got a Windows Forms application that I'd like to NOT have an
app.config file for. So far in the development of the app, that hasn't
been a problem.

However, I'm currently looking at making it more of a modular app, using
dynamic discovery of components at runtime. These components will be DLL
assemblies and I'd like them to be in a subdirectory of the main app
directory:

path\mainapp
path\mainapp\libraries

At startup, reading through that directory and determining which
components are available is easy enough, as is exposing those in the
interface so the user can launch them.

But to actually launch them, the executing assembly will need to (again)
know where to find the component assemblies and I'm wondering if I can
programmatically specify the "libraries" directory above as a location to
probe for assemblies at runtime. If not, it seems that I can specify the
path when I use Assembly.Load() to get at the Type that's being created...
still, I figured I'd check to see if that's really necessary, as it seems
more "clean" to just tell the executing assembly about another possible
directory to probe.

There are all sorts of references for specifying the privatePath in
app.config, but I don't see anywhere that the "privatePath" for probing
can be modified, except for in the config file... am I out of luck on this
one?

Regards,

JD

===================================
This list is hosted by DevelopMentor®  http://www.develop.com
Some .NET courses you may be interested in:

NEW! Guerrilla ASP.NET, 26 Jan 2004, in Los Angeles
http://www.develop.com/courses/gaspdotnetls

View archives and manage your subscription(s) at http://discuss.develop.com

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.550 / Virus Database: 342 - Release Date: 09/12/2003
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.550 / Virus Database: 342 - Release Date: 09/12/2003
 

===================================
This list is hosted by DevelopMentor®  http://www.develop.com
Some .NET courses you may be interested in:

NEW! Guerrilla ASP.NET, 26 Jan 2004, in Los Angeles
http://www.develop.com/courses/gaspdotnetls

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to