0
votes

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?

4

4 Answers

2
votes

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.

1
votes

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.

0
votes

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.

0
votes

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