Chris Falter

.NET Design and Best Practices
posts - 42, comments - 82, trackbacks - 24

My Links

News

All source code published on this blog is placed in the public domain.

Archives

Post Categories

Image Galleries

About Me

VS 2005 Gotcha: Project Loading When Opening Solution from Source Control

We have invested a lot of effort into making the file paths for our projects mirror the SourceSafe project hierarchy, per the long-standing Microsoft “Team Development” whitepaper (especially chapter 3).  The initial solution developer, typically the team lead, creates a blank Visual Studio solution, then adds the various projects at the solution root.  To illustrate, here's the directory structure from a solution I created recently:

After the solution is checked in to source control, the project hierarchy in SourceSafe will mirror the file directory structure:

Any subsequent developer who opens the solution will find that its projects are all “auto-magically” loaded at the correct file path.  Hence all developers who work on the solution will share the same file directory structure, and painless collaboration is assured.  (Except for the weekly project management meetings...)Yes, you have entered programming heaven.  

Unless St. Peter notices you're using Visual Studio 2005, in which case he bars you at the gate.

Try opening someone else's solution in VS 2005, and you'll find your projects being loaded in a location like C:\Documents and Settings\MyUserName\My Documents\Visual Studio 2005\Projects\Projects\Dev\Utils\etcetera.  Argh!  What happened?

After a bit of IDE spelunking, I opened this little dialog from the Tools => Options menu:

Tools Options Default

So you see, Visual Studio 2005 believes that you want to load all projects into the default VS projects location, regardless of what your source-controlled solution file might say to the contrary. And if you've redirected your “My Documents” folder to a network drive so your IT department will back it up daily, the way I have, VS 2005 will be polite enough to tell you that code access permissions will prevent you from running your code.  Oh, how kind! 

Fortunately, this problem is not too hard to fix.  Just change the default location to a root directory...

Tools Options Correct Setting

...and St. Peter will let you pass through the pearly programming gates.

Print | posted on Monday, April 03, 2006 7:36 PM | Filed Under [ .NET Gotchas ]

Feedback

Gravatar

# re: VS 2005 Gotcha: Project Loading When Opening Solution from Source Control

It may be a good idea to change the title os this post to specify that this is when you are using Source Safe. I have not used Source Safe with VS2005 but when used with Team Foundation Version Control, a workspace mapping is required, which specifies the location of the source on your local drive.
4/5/2006 2:18 PM | Anonymous
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification:
 

Powered by: