How multiple web sites can share one binary folder

I answered a post about how you can share a single binary folder with many web sites. I can certainly see the advantage of having configurable sites (different web configs) but share the same binary folder to make it easier for maintenance. My first thought was that you could use virtual folders but unfortunately the code probing won’t see the virtual folder…shame. So I looked into the ye olde unix (or nix) style of symbolic links, thing create shortcut link on steriods.  My first idea was to create a ‘hardlink’ of the bin folder itself. E.g.


Web1\Bin (really hardlink to ActualBinaries\Bin)

Web2\Bin (really hardlink to ActualBinaries\Bin)

Although the CLR did indeed go to the correct folder it failed to load the assemblies in there complaining that the format of the path was wrong. So sensing that I was close to something I tried creating an real bin folder and hardlink the indicidual files. E.g.


Web1\bin\MyComponent.dll (really hardlink to ActualBinaries\bin\MyComponent.dll)

Web2\bin\MyComponent.dll (really hardlink to ActualBinaries\bin\MyComponent.dll)

Now that worked! So how do create one of these links? Well it’s actually quite straightforward;
fsutil hardlink create

Apparently Powershell can easily create them too, although I’ve yet to try that. So is it worth the effort? I can see that running one MSI would be handy, especially when you’ve got COM registrations going on. However if you’ve only got .net components and no extra registrations then I doubt it’s worth the extra effort.

One thought on “How multiple web sites can share one binary folder

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s