Web project file structure

If you are having a problem using Vault, post a message here.

Moderator: SourceGear

Post Reply
Guest

Web project file structure

Post by Guest » Thu Feb 26, 2004 5:42 pm

Reading the "Creating a VS.Net web project with Vault" FAQ, it says:

"9. You will be prompted to choose another location (for project files). Make sure to choose the exact same location as you chose in the previous step." - where the previous step was the location to place the solution file.

Is this saying to place the project files in the same Vault location as the solution file? If so, then you could not set the working folder for the solution to be C:\Documents and Settings\<user>\My Documents\Visual Studio Projects\<project> and have the working folder for the project files be C:\Inetpub\wwwroot\<project>

Am I misreading step 9 of the FAQ, or should the project files really be put in a Vault subfolder of the solution file?

ulfius

Post by ulfius » Tue Mar 02, 2004 2:21 pm

Anyone?

jclausius
Posts: 3702
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Post by jclausius » Tue Mar 02, 2004 2:52 pm

ulfius:

i'm not an expert in this area, but i just tried a sample. someone please correct me if i made a boneheaded mistake.


1) created a dummy web app (WebApplication1)
2) added it to a repository ( $/jeff was the parent. the full path was $/jeff/WebApplication1)
3) it then asked me to choose a location for project/solution, i chose $/jeff/WebApplication1. same as in step 2.

i now have a flat architecture where $/jeff/WebApplication1 maps to c:\inetpub\wwwroot\WebApplication1. note, all files (.csproj, .sln, global.asax, webform1.*, etc) are all within this one directory.

it looks like the directions are having you place the project/solution files in the same directory as the web app.

hth
Jeff Clausius
SourceGear

jeremy_sg
Posts: 1821
Joined: Thu Dec 18, 2003 11:39 am
Location: Sourcegear
Contact:

Post by jeremy_sg » Wed Mar 03, 2004 12:32 pm

If I understand your question correctly,

Our KB article (http://support.sourcegear.com/viewtopic.php?t=222) reccommends a directory structure that puts the solution file and the project files in the same directory. This assumes that all of the projects are ok being in the same directory. You are wondering if this takes away the ability to set a different working directory for a subfolder.

For example, I created a Web application solution that looks like this in the solution explorer.

Code: Select all

Solution WebApplication1
   ClassLibrary1
      References
      AssemblyInfo.cs
      Class1.cs
   WebApplication1
      References
      AssemblyInfo.cs
      Global.asax
      Web.config
      WebForm1.aspx
When I follow the instructions in the KB article, I see a structure in Vault like this:

Code: Select all

$/directory_I_chose_both_times
   WebApplication1
         AssemblyInfo.cs
         Global.asax
         Global.asax.cs
         Global.asax.resx
         Web.config
         WebApplication1.csproj
         WebApplication1.csproj.vspscc
         WebApplication1.sln
         WebApplication1.sln.vspscc
         WebForm1.aspx
         WebForm1.aspx.cs
         WebForm1.aspx.resx
      ClassLibrary1 (subfolder of WebApplication1)
         AssemblyInfo.cs
         Class1.cs
         ClassLibrary1.csproj
         ClassLibrary1.csproj.vspscc
You're right, that doesn't look much like the solution explorer. If you select the directory that got created, then the structure looks exactly like the one in the solution explorer, and you have more freedom to sprinkle the projects around your hard drive. I'll change the KB article to reflect this better practice.

To sum up, the better way to add the solution to source control is to select $/trunk in the first dialog, and select $/turnk/WebApplication1 in subsequent dialogs.

Guest

Post by Guest » Thu Mar 04, 2004 12:33 pm

So for a web project, would I branch at the project level or solution level?

jeremy_sg
Posts: 1821
Joined: Thu Dec 18, 2003 11:39 am
Location: Sourcegear
Contact:

Post by jeremy_sg » Thu Mar 04, 2004 2:51 pm

Given the following structure:

Code: Select all

$/trunk/src/WebSolution
$/trunk/src/WebSolution/WebSolution.sln
$/trunk/src/WebSolution/WebProject/WebProject.csproj
$/trunk/src/WebSolution/ClassLibrary/ClassLibrary.csproj
If you needed to branch WebProject, but knew that you weren't going to have to change ClassLibrary, then you have several options.

1. Branch $/trunk/src/WebSolution to $/branches/WebSolution. This gives you the easiest time, because you can just download to a different directory and work in the new location. The tradeoff is that you have more nodes in your Vault tree.

2. Branch just $/trunk/src/WebSolution/WebProject to $/branches/WebProject. With tweaking of the working folders and IIS virtual directories, this would allow you to use the $/trunk/src objects for all but the files in WebProject.

I don't claim that this is solid advice, or even that it would work for you, since everyone's workflow is different. I can say that here at Sourcegear, we branch at the solution level, but then we've only had to do that less than 10 times in the time that we've been working on Vault. If you branch more frequently, then you will not want so many extra nodes in your tree.

Post Reply