Specify probing location WITHOUT app.config?

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
 
M

Marc Scheuner [MVP ADSI]

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top