Sirsha.com

Sometimes I like to think about...  stuff... .. .
Welcome to Sirsha.com Sign in | Join | Help
in Search

Sirsha Development Resources Blog

because everyone always wants more documentation...

Changing Project File Paths in VS.Net 2003

My main desktop has a small drive, a tiny drive, a 15GB hard drive that is over 4 years old and has a lot of mileage on it.  Today I finally installed the 80 GB IBM drive that I've had sitting on my desk since my hero Jimmy donated it to me at Thanksgiving.  Installation was a breeze; partitioning and fomatting were a snap.  Moving my “My Documents” folder to it's own 40 GB partition was both simple and liberating.  And then I launched Visual Studio.

Not all but most of my project files were in My Documents and VS hard-coded the paths.  So now the projects aren't there.  That's not the dumbest thing I've ever heard, by far.  It's not exactly the smartest decision ever made, but I'm sure I've done worse recently.  The problem is this: There are a few solution files I am able to open but the projects in those solutions throw big loud errors (my PC is connected to a handful of speakers that supply all of my music) that shake the floor and worry the neighbors.  I figure it's no big deal, I'll just change the targets and have VS look in the correct place for them.  No dice.  The only options in the context menu are “reload project” and “remove project”.  I certainly don't want to remove, so I try to reload, assuming (yeah, I know, I know) that when the file isn't found I'll be given a “browse” button.  No dice.  More Earth-shaking error dialogs and some extremely helpful information telling me the project “has been moved, renamed, or is not on [my] computer”...  well, yeah, that's cool, but I know where it is, why don't you ask me?  But no... VS doesn't care.  “It's not there!” it keeps telling me, deaf to my instructions, pleadings, and cursings.

Why does Visual Studio hate me so?

So, is there a way to do this other than removing the projects and adding them again? 

[update:  just wanted to point out that this isn't really a big deal at all, 90% of my development is on another test server, this is only a problem for little test/proof of concept/example/demo projects I have locally.  It is still a PITA, though, and I am amazed that it is an issue at all.]

Published Saturday, December 20, 2003 11:39 PM by sjh
Filed under: ,

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

 

jayson knight said:

in a word...no, at least not from a retroactive standpoint. here is a system i devised long ago to combat just this issue though (after lots of similar hair pulling, kicking, screaming, etc). for non-web apps, map a virutal drive to your VS projects folder, then in VS props change your Environment/Projects and Solutions location to this virtual drive letter. no matter where you save your SLN file, it will reference projects using using the drive letter (the caveat here being you need to save all your project files in the same directory, which is probably the best thing to do anyways). sharing your VS projects file (with the appropriate perms) and then using a UNC name in VS Environment/Projects and Solutions property will provide the same functionality. i don't know how windows ACL GUIDS will affect the latter if you format, i am assuming the value is simply stored as a DWORD in the reg and VS won't do any ACL GUID checking. for web projects the process is very similar, simply change the Local Path prop in the IIS MMC console for the root web site dir to either a UNC name or a virtual drive letter mapped to the folder on the file system, VS.NET will then hardcode these values into SLN files. if you format, all you need to do when you are done is redo the drive mappings/folder sharings, change the settings in VS.NET, and you should be good to go. i personally use drive mappings and haven't run into any issues when it comes to swapping out drives, so long as i've kept my project files nice and tidy. i know that doesn't fix the issue at hand, but if you move to this system, it will prevent this from happening in the future.

cheerio
j
December 21, 2003 2:52 AM
 

jayson knight said:

update

it has been a while since i implemented the above...IIS only supports UNC references, not virtual drive mappings. if you use a UNC name, it will be hardcoded in the SLM file using the UNC name, which will still prevent any future issues with project files being moved.
December 21, 2003 3:13 AM
 

TrackBack said:

December 21, 2003 7:38 PM
 

Shannon said:

cool, thanks Jayson.
December 22, 2003 9:03 PM

Leave a Comment

(required) 
(optional)
(required) 
Submit
Powered by Community Server, by Telligent Systems