Vivian River
Vivian River

Reputation: 32400

Why does Visual Studio 2008 try to open a project from the wrong folder?

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?

Upvotes: 1

Views: 670

Answers (4)

Danny
Danny

Reputation: 11

I fixed this by closing Visual Studio, deleting the .suo file then reopening Visual Studio.

Upvotes: 1

Vivian River
Vivian River

Reputation: 32400

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.

Upvotes: 1

Mike Marshall
Mike Marshall

Reputation: 7850

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.

Upvotes: 2

rlb.usa
rlb.usa

Reputation: 15041

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).

Upvotes: 0

Related Questions