My current project at work is a web project. Since we are now evaluating Subversion, it was my responsibility to get the web project stuffed into Subversion properly, and make the life of my dev team easier while doing it. So, I bring you my thoughts on how to properly set up an ASP.NET project in Visual Studio and stuff it into a Subversion repository using the AnkhSVN plugin. This little tutorial mostly applies to Visual Studio 2003, but can easily be modified by a mere step or two to apply to Visual Studio 2005.
(0. Create your subversion repository and set it up for access with AnkSVN plugin. This really isn't covered by me at this point, hence step "0". There are plenty of places that discuss this. Just Google it.)
1. Create a standard source tree on your local system.
This is actually the most important and most mis-understood part of properly utilizing ANY source control system. If you don't have a standard source tree layout, I would highly recommend developing a standard and utilizing it across all application types - including web projects. Whatever source tree you come up with, make sure it's all housed within a single parent directory for your project (or projects, depending on the size and complexity of the app you are building). For example, start with C:\Dev\My Project\. From there, you create all of your project, solution, documentation, etc. folders.
2. Create a Virtual Directory in IIS and point it to the code folder of your source tree.
Like I said before - your source tree determines the success of utilizing any source control system. Let's assume that your web project will live at C:\Dev\My Project\Code\My Project Web\. Create a virtual directory in IIS, at the root of LocalHost or whatever web project you have, and point it to C:\Dev\My Project\Code\My Project. Also at this time, ensure that the appropriate system accounts have access to this folder. This usually involves "IUSR_(machine)", "IWAM_(machine)", and/or "ASPNET" for Windows XP and for Windows Server 2003, the "Network Services" account.
3. Create an EMPTY SOLUTION in VS.NET and save it to your source tree.
This step is important - DO NOT, UNDER ANY CIRCUMSTANCES, EVER LET VISUAL STUDIO CREATE THE SOLUTION FOR YOU, WHEN YOU CREATE A NEW PROJECT! Even in VS2005 with the fancy new "create folder for solution" option... just don't do it. You should get in the habit of manually creating your solution and adding projects to it one by one. Or find a nice tool that appropriately creates them for you. Just don't let Visual Studio do it for you. This all goes back to your source tree. Use your source tree appropriately, or you'll just cause headaches for yourself later. Of course, your source tree can be anything you want, as long as it's standardized within your development efforts (and/or your team's efforts).
For this example, let's save our solution to C:\Dev\My Project\Code\My Project.sln
4. Add the web project to your solution.
Simple enough - just "Add New Project" and create your web project, or if you've already got the project files, "Add Existing Project". Either way, just make sure you point the project to your virtual directory that you created in step 2.
5. Add your source code to your Subversion repository.
Ah, the heart of the matter at hand... and by far, the easiest step in the process. Now that you have a solution with a web project in it, all you need to do is right click on the solution in Visual Studio's solution explorer, find the "AnkSVN" sub-menu and import the project into subversion via the menu. It will pop up a nice friendly dialog that lets you comment your add, and viola! Your source control is in action for this project.
Conclusion:
Fairly simple, eh? And did you notice how strikingly familiar this sounds? How it looks like your are just adding any other project to your source tree? Well, truth is - you are just adding any ol project to your source tree. The mysteries and black magic that Visual Studio 2001/2003 pulled off to create "Web Projects" are actually quite bogus and only cause problems with good source control systems like Subversion. The only difference between adding a Winforms project, class library, web project, or any other type of project is that when you add a web project, you need to create a virtual directory that points to the actual location of the web project files. Aside from that, this same process can be used for any type of project in your solution.