.net ddls'' in differnet directories?

Discussion in 'ASP .Net' started by Darren Clark, Aug 19, 2003.

  1. Darren Clark

    Darren Clark Guest

    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
    Darren Clark, Aug 19, 2003
    #1
    1. Advertising

  2. Darren Clark

    Darren Clark Guest

    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]" <> wrote in message news:O9M2$...
    > 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" <> wrote in message
    > news:...
    > 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
    >
    >
    Darren Clark, Aug 19, 2003
    #2
    1. Advertising

  3. 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" <> wrote in message
    news:...
    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]" <> wrote in message
    news:O9M2$...
    > 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" <> wrote in message
    > news:...
    > 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
    >
    >
    Jay B. Harlow [MVP - Outlook], Aug 19, 2003
    #3
  4. 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
    --
    my email 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
    Richard Grimes [MVP], Sep 3, 2003
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?ISO-8859-1?Q?Mattias_Br=E4ndstr=F6m?=

    Two pointers to the same obejct, two differnet values...

    =?ISO-8859-1?Q?Mattias_Br=E4ndstr=F6m?=, Dec 18, 2003, in forum: C++
    Replies:
    3
    Views:
    283
    Jumbo
    Dec 18, 2003
  2. alf
    Replies:
    3
    Views:
    315
    Steve Holden
    Nov 2, 2006
  3. mike
    Replies:
    3
    Views:
    385
  4. Mark B
    Replies:
    10
    Views:
    1,667
    Scott M.
    Feb 8, 2010
  5. Junkone
    Replies:
    4
    Views:
    104
    Eric Hodel
    Jun 13, 2008
Loading...

Share This Page