[WARNING! This is an archived post and as such there may be things broken/missing here.. you have been warned.]
[Note this is a .Net 1.1 solution to the problem (.NET 2.0 has an easier solution I believe); it might work for VS.Net 2002 as well as VS.Net 2003... This is a pretty long post. I actually give you a short answer before going into the lengthy discussion]
As you may know I support a combination ASP/ASP.NET site at work. This site atually has a total of 10 subapps that are housed in individual subdirectories off the main site (for each "wing" ASP.NET or ASP). As I'm converting the ASP site over I have started to realize something that is a bit worrisome to me; everytime I get ready to release something (bit or small) I have to do a full deploy of the DLLs because I only have 1 web project.
After some research and picking the brains of several co-workers, I came up with the solution (and since I couldn't find an answer online, I'm posting it).
Let's simplify this a bit so you can see what you have to do. Assume that you have a site that looks like this...
Since the full answer is rather lengthy, let me give you the short answer (if you just want to get the idea). You have to make each subdirectory it's own project. Each subdirectory must not reference the MainSite, but the subsites can reference each other. Finally you reference the subdirectories in the main project, and can deploy the MainSite's Bin directory and all the web files.
Here's the Long answer.
The goal is to have a SubSite1.dll and a SubSite2.dll in the bin directory of the MainSite. BTW, the "_Controls" subdirectory is where I put my custom controls and user controls.
Ok, so if you already have this set up with everything in a single web project, here's what you need to do to switch SubSite1's code into it's own DLL. Remove the SubSite1 subdirectory from the main web project and create a new web project that points to the SubSite1 directory (I like to create an empty web project and point it to the existing directory). This will cause the SubSite1 directory to be registered with IIS as an application; go into the IIS Administration control panel item and make the SubSite1 subdirectory not an application. This will also create a Global.ASAX and a Web.Config in the SubSite1 directory which I delete.
Now you should have an empty directory. Make sur ethat you are in the new SubSite1 Project and click on the icon in Solution Explorer of Visual Studio that shows all files. You will now see all your files, but they aren't a part of the project. Right click on all the pages and code in the subdirectory and add them into the project.
All done right? Nope. Try compiling the new project... it won't work; you're going to probably have a bunch of errors. You need to go through this same process with the _Controls subdirectory. Work with _Controls and get it to compile without adding a reference to the MainSite application; you may need to move some code around to get this to work. You may want to create a separate DLL project to hold common code. BTW, you may also have to adjust some namespaces.
Now add a reference to the _Controls project to the SubSite1 project. You will probably have a lot less errors compiling this project now. Work to get the SubSite1 project to compile without a reference to the MainSite project (so you'll be moving code around again, but be careful not to break the _Controls project... you'll probably want to put some of the necessary code in the common code project... also, like before you may also need to adjust some namespace references).
Once you have the SubSite1 project working (and hopefully you're still with me), then you really just need add the SubSite1 project as a reference to the MainSite project; the MainSite project will also probably need a reference to the _Controls project and the common code project (if you built one). Now when you deploy you can deploy the web files (aspx, ascx, asax, Web.Config) for all the directories and just the DLLs in the MainSite project's bin directory.
The beauty of this is that if you have to change the SubSite1 subdirectory you may only have to re-deploy a single DLL... or just the changes. There can be versioning issues that might make you have to deploy the MainSite DLL again as well, but after this process MainSite probably has less code in it.