Specify probing location WITHOUT app.config?

  • Thread starter Thread starter JD
  • Start date Start date
J

JD

I've got a Windows Forms application that I'd like to NOT have an app.config
file for. There are, however, a few "utility" assemblies used by the
application and I'd like them to be in a subdirectory of the main app
directory:

c:\mainapp
c:\mainapp\libraries

I'm wondering if I can programmatically specify the "libraries" directory as
a location to probe for assemblies at runtime. I don't see anywhere that the
"privatePath" for probing can be modified, except for in app.config... am I
out of luck on this one?

Regards,

JD
 
I've got a Windows Forms application that I'd like to NOT have an app.config
file for. There are, however, a few "utility" assemblies used by the
application and I'd like them to be in a subdirectory of the main app
directory:

You could add those to your current AppDomain programmatically:

AppDomain.CurrentDomain.AppendPrivatePath(<your path>);

Should work.

Marc
================================================================
Marc Scheuner May The Source Be With You!
Bern, Switzerland m.scheuner(at)inova.ch
 
Back
Top