.net ddls'' in differnet directories?

D

Darren Clark

Is it possible to have your main exe and app in the top level folder...
BUt then to have any library dlls in a different folder..

eg
myApp would store the main exe and config files etc..
myApp/ddls/ woudl store all the dlls that the main app needs to reference.....


How would this be possible to do ,... as each time i compile it moves all referenced dlls in to the bin direcotry with the exe...

thanx in advance.

Darren
 
D

Darren Clark

FANTASTIC!!! Just tried on a quick demo project and it is exactly what i was after...

vs 2002 code below..........
static void Main()

{

AppDomain.CurrentDomain.AppendPrivatePath("dlls");

Application.DoEvents();

Application.Run(new Form1());

}


thanx for that.

Darren Clark
 
J

Jay B. Harlow [MVP - Outlook]

Darren,
You shouldn't need the DoEvents in VS.NET 2002.

It is there in VS.NET 2003, as there is a feature with EnableVisualStyles,
that some controls do not display the Windows XP themes correctly without
it.

Hope this helps
Jay

FANTASTIC!!! Just tried on a quick demo project and it is exactly what i was
after...

vs 2002 code below..........
static void Main()

{

AppDomain.CurrentDomain.AppendPrivatePath("dlls");

Application.DoEvents();

Application.Run(new Form1());

}


thanx for that.

Darren Clark
 
R

Richard Grimes [MVP]

The runtime will check the following locations automatically for the
libraries used by the app:

1) the current folder
2) a sub folder with the short name of the library, eg if the library is
called MyUtils.dll this can be put in a sub folder called MyUtils
3) the global assembly cache.

If you use a config file (which *must* be in the same folder as the app) you
can specify the name of a sub folder for the libraries using the <probing>
element (see
http://msdn.microsoft.com/library/en-us/cpgenref/html/gngrfprobing.asp).
eg
myApp would store the main exe and config files etc..
myApp/ddls/ woudl store all the dlls that the main app needs to
reference.....

In your case you could use:

<probing privatePath="ddls"/>

Richard
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top