Changing location of the /bin directory

Discussion in 'ASP .Net' started by Dylan Parry, Sep 9, 2009.

  1. Dylan Parry

    Dylan Parry Guest

    Hi,

    Please forgive me if this isn’t the correct newsgroup – if it’s not,
    which one would be a better choice? Anyhow, to my question…

    By default, the “/bin†directory where you’d keep all the DLL files for
    a web application is set to live within the root directory of the site.
    What I’d like to do is move it to somewhere else and still have my site
    use it. Eg.

    My site lives at “C:\iis\sites\mysite\†and the “/bin†directory is at
    “C:\iis\sites\mysite\bin\â€. I’d like to create a directory at
    “C:\mybin\†(or anywhere else for that matter) and have my site use that
    directory as its “/bin†directory.

    The reason I want to do this is so that more than one site can share the
    same “/bin†directory without me having to mess around with the GAC,
    which annoyingly requires an IIS restart every time the DLL files are
    updated. I have several client sites that all use the same DLL files, so
    having them stored in a central location makes it much easier to
    maintain rather than having to upload the same DLLs to a dozen or more
    sites each time I fix a bug or add a new feature!

    I’m currently using the GAC for this, but it’s messy and I thought it
    would be much more sensible to have some sort of shared “/bin†directory
    that would only store DLL files relevant to the application.

    Okay, now I’m babbling. Short story: is this possible?

    Cheers,

    --
    Dylan Parry
    http://electricfreedom.org | http://webpageworkshop.co.uk

    “If I had my life to live over again, I'd be a plumber†– Einstein
     
    Dylan Parry, Sep 9, 2009
    #1
    1. Advertising

  2. Dylan Parry

    Patrice Guest

    Patrice, Sep 9, 2009
    #2
    1. Advertising

  3. Dylan Parry

    Dylan Parry Guest

    Patrice wrote:
    > Hello,
    >
    > Try perhaps :
    > http://msdn.microsoft.com/en-us/library/823z9h8w.aspx (but it looks like it
    > should be a subdir).


    Indeed. Doesn’t look like that would work :(

    > You could also try at the OS level for example you could try how it behaves
    > when you use a hardlink :
    > http://technet.microsoft.com/en-us/library/cc788097(WS.10).aspx


    That’s a possibility, but it would require having to set up hardlinks
    for each DLL file within the “/binâ€. I guess I could do that with a
    “.bat†file when I set up the sites, but could be a lot of work if I had
    to add a completely new DLL to a site. Can’t see any way of setting up
    hardlinks for a directory rather than a single file – is that possible?
    If so, that would be a much easier solution…

    > For now my personal preference has always been to use a batch file (possibly
    > based on robocopy) to keep several sites in sync (and I still keep the
    > ability to handle them individually when needed).


    Yes, I used to do that too before resorting to the GAC. Problem there
    was that it got to the point that there were so many sites that it made
    maintaining the “.bat†a PITA; I’d inevitably forget to add a new client
    to the script at some point, and the world would tumble down around me :(


    --
    Dylan Parry
    http://electricfreedom.org | http://webpageworkshop.co.uk

    “If I had my life to live over again, I'd be a plumber†– Einstein
     
    Dylan Parry, Sep 9, 2009
    #3
  4. Dylan Parry

    Samir Bouzid Guest

    Hi Dylan,

    Normally you should be able to move the /bin directory anywhere in your
    application, but you can't do this at the root of you hard drive (i.e:
    C:\). This is due to permissions rights and security.

    A good way is to keep this directory at its original place because it's
    project dependent.

    If you want to share components between several projects you'd better
    link the assemblies into the reference folder in Visual Studio.

    P.S : Sorry for my English I'm a French.

    Samir



    Dylan Parry wrote:
    > Patrice wrote:
    >> Hello,
    >>
    >> Try perhaps :
    >> http://msdn.microsoft.com/en-us/library/823z9h8w.aspx (but it looks like it
    >> should be a subdir).

    >
    > Indeed. Doesn’t look like that would work :(
    >
    >> You could also try at the OS level for example you could try how it behaves
    >> when you use a hardlink :
    >> http://technet.microsoft.com/en-us/library/cc788097(WS.10).aspx

    >
    > That’s a possibility, but it would require having to set up hardlinks
    > for each DLL file within the “/binâ€. I guess I could do that with a
    > “.bat†file when I set up the sites, but could be a lot of work if I had
    > to add a completely new DLL to a site. Can’t see any way of setting up
    > hardlinks for a directory rather than a single file – is that possible?
    > If so, that would be a much easier solution…
    >
    >> For now my personal preference has always been to use a batch file (possibly
    >> based on robocopy) to keep several sites in sync (and I still keep the
    >> ability to handle them individually when needed).

    >
    > Yes, I used to do that too before resorting to the GAC. Problem there
    > was that it got to the point that there were so many sites that it made
    > maintaining the “.bat†a PITA; I’d inevitably forget to add a new client
    > to the script at some point, and the world would tumble down around me :(
    >
    >
     
    Samir Bouzid, Sep 9, 2009
    #4
  5. Dylan Parry

    Dylan Parry Guest

    Dylan Parry wrote:

    > Can’t see any way of setting up hardlinks for a directory rather than
    > a single file – is that possible? If so, that would be a much easier
    > solution…


    I found a small command line application called “linkdâ€, which is part
    of a set of tools from Microsoft. Seems it allows me to set up something
    called “junctionsâ€, whatever they are! Either way, they look like
    shortcuts in Explorer, but you can also see them in the command line, so
    they appear to work in the same way that hardlinks do!

    I’ve given it a try and managed to set up a junction called “bin†in my
    site’s root directory, where the actual directory contents are in
    another directory below the root! So it works wonderfully :)

    Thanks for pointing me in the right direction.

    --
    Dylan Parry
    http://electricfreedom.org | http://webpageworkshop.co.uk

    “If I had my life to live over again, I'd be a plumber†– Einstein
     
    Dylan Parry, Sep 9, 2009
    #5
    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. Kevin Mitchell

    Can "bin" be changed to "cgi-bin" for asp.net

    Kevin Mitchell, Oct 19, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    981
    Wim Hollebrandse
    Oct 19, 2003
  2. Timo

    \bin directory location

    Timo, Apr 6, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    387
    Raymond Lewallen
    Apr 6, 2004
  3. John Salerno
    Replies:
    30
    Views:
    2,011
    Stephan Kuhagen
    Aug 10, 2006
  4. =?Utf-8?B?cGFnYXRlcw==?=

    Bin Directory location - ASP.Net 2.0

    =?Utf-8?B?cGFnYXRlcw==?=, Sep 22, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    463
    Tim Payne
    Sep 23, 2006
  5. anne001
    Replies:
    1
    Views:
    554
Loading...

Share This Page