views:

52

answers:

3

I'm having a bizarre problem with Visual Studio 2008. I wanted to debug one of the libraries that my web application references. Therefore, I decide to add the project containing the library to my solution so that I can debug them together.

The project containing my library sits at c:\webLibs\myproj.vbproj. However, when I try to add the project to my solution, Visual Studio throws the following error: "The project file 'c:\someOtherFolder\myproj.vbproj'. has been moved, renamed, or is not on your computer."

As you can see, VS appears to be trying to open a different file than the one I clicked on. I used to have the file in that other location, but not anymore.

I've tried restarting VS several times.

What could cause this bizarre behavior? Why would Visual Studio try to open my project from the wrong folder?

A: 

Sounds like some wires got crossed and Visual Studio's internal project reference for that project is incorrect. You can clean it up if you are good with your registrys, or you can use a simple tool like this one (I use and like this, it's not mine) to remove the bad project (and later re-add the good one).

rlb.usa
The tool that you link to appears to be for Visual Studio 2005 projects...
Rice Flour Cookies
I have used it for my VS2008 and it performed just fine.
rlb.usa
A: 

Try searching for any .suo or .user files in your source hierarchy, especially in your solution's directory. VS stores hints in those files form time to time that can get things out of sync now and again.

mjmarsh
+1  A: 

I found the problem. I had an errant TFS Source-Control mapping that mapped the project to a non-existent folder on the hard drive.

My web application is in its own workspace. The library that I wanted to reference is in its own workspace where it is mapped to c:\webLibs\myproj.vbproj. However, in the web application's workspace, there was an errant mapping to c:\someOtherFolder\myproj.vbproj.

I deleted the errant mapping and everything worked fine :-)

I believe the moral of the story is to check mappings in all workspaces possibly involved when this sort of thing comes up.

Rice Flour Cookies