pre-sale question concerning web projects

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

Moderator: SourceGear

Post Reply
guest

pre-sale question concerning web projects

Post by guest » Wed Aug 11, 2004 7:43 am

I have read through the posts already made about the use of vault with web projects, and i still have this question. It seems that vault handles visual studio's default behavior where it creates two folders for web projects - one under wwwroot for the source files, and one in your "projects" directory for the solution and project file. I , however, do not like this behavior, and after vs.net creates the directories, I exit - move all the files under wwwroot to the directory created under projects, and then change the virtual directory to point there. This way all my files are in one place. Will vault handle this situation, or will it choke when both working directories are the same.

Thanks,

David Stuart
US Army Corps of Engineers

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

Post by jclausius » Wed Aug 11, 2004 9:18 am

David:

I work the same way. In fact both Dragnet / Vault are mapped this way on my local drive. :D

Here's how I've set this up in the past. (Please note, this is not for the faint of heart.)

[ EDITED CONTENT - My original instructions did not work correctly. I tested these new instructions myself. ]

1 ) Create/Save your Web Application

2 ) Add the solution to Source Code Control. Login in to Vault, etc.

3 ) Pick a repository path for the solution / project files (.sln, .vbproj, .csproj). In this example, I chose $/WebApps, which created $/WebApps/WebApplication1

4 ) Pick a new location for the actual files themselves. Pick a sub folder of the repository path created from step 3 - For example - $/WebApps/WebApplication1. VS.Net will create a $/WebApps/WebApplication1/WebApplication1.

5 ) Exit VS.Net

6 ) Go to IIS Admin tool, delete any remnants of the Web application.

7 ) Find the Solution File, delete the entire directory containing the .sln file.

8 ) Start the Vault GUI client, and remove the assigned working folder for the repository path in step 4. This way, the files will inherit the repository path from the path specified in step 3. Do a recursive Get Latest on the Web Application's Solution directory ($/WebApps/WebApplication1).

9 ) Re start IIS Manager. Create a new Virtual Directory (WebApplication1) mapping $/WebApps/WebApplication1/WebApplication1 to your local directory (c:\Documents and Settings\%USERNAME%\My Documents\Visual Studio Projects\WebApplication1\WebApplication1).

10 ) Restart VS.Net. Open the Local Project. You will receive some errors about Source Code Control. You can ignore them.

11 ) With the project loaded, choose File -> Source Control -> Change Source Control. Higlight the .sln row, and click "Bind" in the tool bar. You will be prompted to Log into Vault. Choose the Repository Path from step 3 ($/WebApps/WebApplication1). There will be a second row for the project. Highligh it, and click "Bind". You will choose the repository path from step 4 ( $/WebApps/WebApplication1/WebApplication1).

Finally, it will ask to check out the Solution File. Choose OK. Save everything, and then check the .sln back into Vault.
Last edited by jclausius on Wed Aug 11, 2004 12:35 pm, edited 2 times in total.
Jeff Clausius
SourceGear

guest

OK.. another question

Post by guest » Wed Aug 11, 2004 9:57 am

After I've done all this, if another person wants to get the project, and they do an "Open from source control". Will everything just work? (i.e. the virtual folder gets created, etc.)

David Stuart

dan
Posts: 2448
Joined: Wed Dec 17, 2003 5:03 pm
Location: SourceGear
Contact:

Post by dan » Wed Aug 11, 2004 12:09 pm

Yes, an Open From Source Control will automatically create the virtual folder you need. However, it might not create it where you want it, so you might have to change the location later.

guest

Let me be a little more specific

Post by guest » Wed Aug 11, 2004 12:35 pm

OK. I guess I'm not asking a clear question. Let me be more specific. I create a web project using the steps outlined by Jeff. At that point I have a project located at "c:\mydocuments\visual studio projects\myproject" and there is virtual directory pointed at that directory called "http://localhost/myproject".

Now another user wants to get that project to work on. Since I haven't used vault, I don't know the exact procedure, but I would assume that the user has to map a point on his harddrive to the vault repository. So lets say that the first user mapped "/<vaultrepository>" to his directory "c:\mydocuments\visual studio projects", which means "myproject" exists at "/<vaultrepository>/myproject". So the second user maps his "c:\mydocuments\visual studio projects" directory to "/<vaultrepository">" and then does an "Open from source control".

What I would expect to happen, would be for there to be an identical setup on the second user's machine as on the first user's machine. All the files in one directory with a IIS virtual directory pointed at it. Is this not the case? If not, tell me "exactly" what would happen.

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

Post by jclausius » Wed Aug 11, 2004 1:04 pm

Dave:

If you use "Open From Source Code Control", without setting a Working Folder, the IDE client will ask for a mapping of repository path ($/WebApps/WebApplication1) to Local Drive ( %systemdrive%\Documents and Settings\%username%\My Documents\Visual Studio Projects\WebApplication1).

Please note, when a Web App is created by VS.Net in this manner, VS.Net will place the Web Site under Inetpub\wwwroot (just like when it originally created the project).

The only way I've been able to get VS.Net to use a different path is to:
  • Set working folders on the top level repository path (removing folders from the lower folders).
  • Get recursively from within the Vault client.
  • Create your own virtual directory within IIS Manager.
  • From within VS.Net open the solution locally.
  • Re-bind if there are binding errors.
Note, the steps I outlined are a one time occurrence. Once you've successfully created this environment, you never have to set it up again.

HTH
Jeff Clausius
SourceGear

Post Reply