I've been dealing with this for quite some time now, and have used both Virtual Directories and "user control library" approaches, and have found them both wanting. I'm surprised that microsoft hasn't addressed this issue to compile the user controls to be used like server controls.
Anyways...
There's two conveniences that most of us look for when attempting a user control library:
- Easy to develop against. If we
change a user control, we want to do
it one place. We want to be able to
both edit and debug within the web
we're working, without having to
manage multiple copies of an ascx
file.
- Easy to deploy. We want to be
able to grab and publish the ascx
files in multiple web sites
without much hassle.
Unfortunately, Virtual Directory approach only addresses #2, and "user control libraries" addresses #2, and only part of #1. With a "user control library", you can debug against the user control library source, but if you edit the ascx in your working web, the changes will be over written next time the "user control library" is built. This is similar to how a server control operates: has to be edited elsewhere and has to be compiled to be updated. The exception being that "user control libraries" must be copied, instead of just updating a .dll reference.
Solution?
What I've used to solve #1 are symlinks. Create a common controls folder in your repository, and symlink that folder in to each of the webs as you desire. Any changes you do to the symlink folder are done to the source common controls folder.
To solve #2, I just deploy the full websites with the controls copied to their appropriate locations. You could also easily do a Virtual Directory instead, and not roll out the symlinked folder in each website. I tend to lean away from Virtual Directories for the common user controls hosting source in fear of performance issues (lots of webs, tons of traffic).
I hope this helps!