Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > .net ddls'' in differnet directories?

Reply
Thread Tools

.net ddls'' in differnet directories?

 
 
Darren Clark
Guest
Posts: n/a
 
      08-19-2003
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

 
Reply With Quote
 
 
 
 
Darren Clark
Guest
Posts: n/a
 
      08-19-2003
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

"Jay B. Harlow [MVP - Outlook]" <(E-Mail Removed)> wrote in message news:O9M2$(E-Mail Removed)...
> Darren,
> The easiest way I have found is to use AppDomain.AppendPrivatePath in your
> Sub Main routine.
>
> If you have a Startup Form, you can add a Shared Sub Main to form itself.
>
> Something like (VS.NET 2003 code):
>
> Public Class Form1
> Inherits Form
>
> Public Shared Sub Main()
> AppDomain.CurrentDomain.AppendPrivatePath("ddls")
> Application.EnableVisualStyles()
> Application.DoEvents()
> Application.Run(New MainForm)
> End Sub
>
> End Class
>
> You can use AppDomain.RelativeSearchPath to see what the current search path
> is.
>
> When you compile the project in VS.NET all the assemblies will still be in
> the BIN folder, however you can create a Setup Package that can install the
> assemblies into which ever folder you want. Within in the File System Editor
> of the Setup Project, you can add folders under the Application Folder, then
> have the output or detected assemblies go into the respective folders.
>
> I use the above for my project, I actually have a series of nested folders
> that are appended to the Private Path.
>
> For a project you can change the Output Path, via the "Project's Property
> Pages - Configuration Properties - Build tab", however I'm not sure what
> effect that will have on referenced projects.
>
> Hope this helps
> Jay
>
> "Darren Clark" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> 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
>
>

 
Reply With Quote
 
 
 
 
Jay B. Harlow [MVP - Outlook]
Guest
Posts: n/a
 
      08-19-2003
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

"Darren Clark" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
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

"Jay B. Harlow [MVP - Outlook]" <(E-Mail Removed)> wrote in message
news:O9M2$(E-Mail Removed)...
> Darren,
> The easiest way I have found is to use AppDomain.AppendPrivatePath in your
> Sub Main routine.
>
> If you have a Startup Form, you can add a Shared Sub Main to form itself.
>
> Something like (VS.NET 2003 code):
>
> Public Class Form1
> Inherits Form
>
> Public Shared Sub Main()
> AppDomain.CurrentDomain.AppendPrivatePath("ddls")
> Application.EnableVisualStyles()
> Application.DoEvents()
> Application.Run(New MainForm)
> End Sub
>
> End Class
>
> You can use AppDomain.RelativeSearchPath to see what the current search

path
> is.
>
> When you compile the project in VS.NET all the assemblies will still be in
> the BIN folder, however you can create a Setup Package that can install

the
> assemblies into which ever folder you want. Within in the File System

Editor
> of the Setup Project, you can add folders under the Application Folder,

then
> have the output or detected assemblies go into the respective folders.
>
> I use the above for my project, I actually have a series of nested folders
> that are appended to the Private Path.
>
> For a project you can change the Output Path, via the "Project's Property
> Pages - Configuration Properties - Build tab", however I'm not sure what
> effect that will have on referenced projects.
>
> Hope this helps
> Jay
>
> "Darren Clark" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
Richard Grimes [MVP]
Guest
Posts: n/a
 
      09-03-2003
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...rfprobing.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
--
my email http://www.velocityreviews.com/forums/(E-Mail Removed) is encrypted with ROT13 (www.rot13.org)

Darren Clark wrote:
> 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



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Colors appearing differnet in IE, FireFox, Safari? Mark B ASP .Net 10 02-08-2010 02:50 PM
check differnet pattern match then perform an action mike Java 3 09-18-2008 07:06 AM
can I import the module twice (under differnet names) alf Python 3 11-02-2006 12:53 PM
Cannot ping at differnet times of the day on my wireless network =?Utf-8?B?UmVjb24=?= Wireless Networking 4 01-12-2006 10:03 PM
Two pointers to the same obejct, two differnet values... =?ISO-8859-1?Q?Mattias_Br=E4ndstr=F6m?= C++ 3 12-18-2003 06:43 PM



Advertisments