PC Review


Reply
Thread Tools Rate Thread

Changing location of the /bin directory

 
 
Dylan Parry
Guest
Posts: n/a
 
      9th Sep 2009
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
 
Reply With Quote
 
 
 
 
Patrice
Guest
Posts: n/a
 
      9th Sep 2009
Hello,

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

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

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).

--
Patrice


 
Reply With Quote
 
Dylan Parry
Guest
Posts: n/a
 
      9th Sep 2009
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
 
Reply With Quote
 
Samir Bouzid
Guest
Posts: n/a
 
      9th Sep 2009
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
>
>

 
Reply With Quote
 
Dylan Parry
Guest
Posts: n/a
 
      9th Sep 2009
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
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
~ in IE6 Current Location directory name ? - Bobb - Windows XP General 0 15th Aug 2007 12:51 PM
Bin Directory location - ASP.Net 2.0 =?Utf-8?B?cGFnYXRlcw==?= Microsoft ASP .NET 1 23rd Sep 2006 10:35 AM
Web Setup project - create virtual directory & point to another location in directory structure kplkumar@gmail.com Microsoft C# .NET 0 12th Apr 2006 06:26 PM
\bin directory location Timo Microsoft ASP .NET 1 6th Apr 2004 06:09 PM
Changing default directory/file location Diane Schuette Microsoft Frontpage 1 11th Mar 2004 09:02 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:59 PM.