views:

55

answers:

4

I've been tasked with setting up source control for some Visual Studio 2010 solutions. By default, VS puts its projects into "My Documents\Visual Studio 2010\Projects" which maps to something like "C:\Documents and Settings[user name]\My Documents\Visual Studio 2010\Projects".

When checking out a solution from source control, do most people create a working folder here in this directory and work from there? (This would cause every developer to have a different working directory.) Or do they have each developer setup an identical working folder on each machine (e.g. "C:\dev\projects")?

What is the best practice for this situation?

+1  A: 

You can put your working folder anywhere. In Visual Studio projects, you keep all paths relative so the working folder doesn't matter. I'd guess most developers work out of their working folder.

Solution files (.sln) work in this manner, so you can copy-paste a solution anywhere and the files still work. Source control also should not care where the solution is located, and works relative to the solution base folder.

Personally, I moved the working folder to a separate data drive, at D:\Projects\, but it really comes down to each developer's preference.

Will Eddins
A: 

I'm not sure what the 'best' practice is, but I have a vss folder on my c:\ drive I use as the parent for my working folders.

Not everyone likes working on source code on their hard drive, so they'll go to their personal network folder instead, but with MS and SQL server security, I haven't been able to get that to work.

Beth
Not working on source code on your own hard drive: Why? Source control is there to keep the code backed up (just check in small and often), and specifically to *isolate* you from network issues. When the network goes down, you won't be able to do any work!
Jason Williams
Yeah, I agree. I work on c:\ just fine, but some of my co-workers (and managers) don't like that. My hard drive could crash and then I'd lose all that work I hadn't checked in. Course our network's been unavailable more frequently than my hard drive's crashed, but hey, folks have their opinions.
Beth
+1  A: 

I'd recommend a folder with a short name at the root of a drive, e.g. "C:\Projects" or "D:\Code". File paths are limited to 260 characters. The "My Documents" location cripples you before you even start.

Secondly, Make all paths/references within your source code relative. Then you can put the code in "C:\Code" or move it to "D:\Work" by simply editing your workspace mapping. THis is vital for allowing you to build historical versions of your codebase and keep them alongside current ones (handy sometimes) or to build the code on a build server, or in cases where developers can't put their code in exactly the same place as you first put it. (e.g. when they run out of room on C: and have to move to D:)

Also, try ot have a common path for all developers (e.g. "Code": but allowing a different drive letter as necessary). This allows devs to jump onto each others PCs and find stuff easily, and allows you to set up fixed antivirus exclusion folders on your antivirus server so that your build times aren't crucified.

Jason Williams
I think I'm probably going to follow your suggestion and create a directory on the root of the C: drive. Our source control system (StarTeam) is real picky about working folders, so it will make it easier if all devs have the same layout.
Slapout
A: 

In my firm we have a D:\ where we put our source and solution files.

mslot