Answered by:

The project file * has been moved, renamed or is not on your computer

Question

Hi, somehow my VS2005 Team Suite is still looking in the old/wrong path for my project file and I can't figure out why it's looking there. So here's the deal:

A while ago I created a solution with 3 projects in it; two C# class projects and one Website project. Life was good and everything worked fine, wonderful. Since then, I have acquired a new development workstation and have been developing happily ever after... until today, when I had to revisit my old Solution.

Upon opening the old solution file I was prompted with a dialog indicating that it could not load one of my C# class projects because it has been moved or renamed. I OK'd the dialog and attempted to re-Add the project. To try and add my project back into the solution I right-clicked the solution in Solution Explorer and chose Add | Existing Project. I then manually browsed to "C:\dev\utilities\utilities.csproj" and hit Open.In doing this, an error dialog appeared saying: The project file 'c:\code\utilities\utilities.csproj' has been moved, renamed or is not on your computer. Even though I specifically browsed to a project in "c:\dev", it was trying to open a project in "c:\code"!? Well, originally when I created the solution it WAS in "c:\code", but today all my local code is in "c:\dev" and my TFS Workspace reflects that. I checked all of the *.csproj and *.sln files but can't find ANY references to the path "c:\code". I even tried deleting the *.vspscc file but that didn't help either.

So I guess my question boils down to: Where is VS getting that old path from and how can I get it to look in the right location?

Answers

I was able to solve this problem by closing VS2005 and then deleting the solution's .suo file. I then restarted VS2005 by double-clicking the .sln file and was able to add the other project to the solution.

There have been a number of bugs fixed in this area...it's not clear whether you've hit one of them or if VS is confused for a "legitimate" reason :)

Here's something to try: load the solution, go to File -> Source Control -> Change Source Control, click Unbind on each row. Save the solution. Open Source Control Explorer, delete the solution & related files from the repository. Now re-run the Add Solution To SCC wizard. That should clear up just about any sln-binding issues.

All replies

There have been a number of bugs fixed in this area...it's not clear whether you've hit one of them or if VS is confused for a "legitimate" reason :)

Here's something to try: load the solution, go to File -> Source Control -> Change Source Control, click Unbind on each row. Save the solution. Open Source Control Explorer, delete the solution & related files from the repository. Now re-run the Add Solution To SCC wizard. That should clear up just about any sln-binding issues.

I was able to solve this problem by closing VS2005 and then deleting the solution's .suo file. I then restarted VS2005 by double-clicking the .sln file and was able to add the other project to the solution.

Did somebody investigate why this happens? Is it related to source control or does it happen even without any bound projects? Is here a know issue regarding this behaviour?

We're loosing a lot of time "playing" around with those unexpected and never wished features of vs (every version). Are there any plans to release a service pack soon or does it take ages again like for vs 2003?

We too are having this problem. We delete our system folders, clear our workspaces from the client and tf server, and still when we try to load the solution (after closing and reopening VS), we are experiencing problems. We have already consumed 3 man days and still do not have it fixed. BTW~ Everyone else is down waiting for this fix.

I do not know for sure, but I think the directory setup can also be a problem. Make sure all websites in the solution are in a directory located under the solution. Best is to have all projects in a directory under the solution.

I just had this issue with Visual Studio 2010 after converting to Team Foundation Server 2010 from VSS. All I did was delete the .suo file for the solution I was trying to add the other project to, and it fixed the issue. Crazy that 4 years later, this issue still exists.

I was running into this as well, but none of the solutions in this thread worked (I don't even have an SUO file to delete!). The one thing that was odd about my solution was that I have a C# library project and an ASP.NET web site project with the
same name, in different folders on the file system, but both in the same solution. This "worked fine" when I originally developed this solution 5 years ago, but now, after moving to a new computer and to VS2008, all I could get out of VS was this most
unhelpful error message.

The thing that appears to have solved it? I renamed the website project. I can only assume that something in VS is being careless about handling project names and somehow confused the two.

Another thing that appears related is the use of solution folders - even if the solution folder actually mirrors a filesystem folder in the same solution-relative location. I had a couple of websites that were in {sln-dir}/Websites/{site-name} that
were added to the solution in a Websites solution folder, but the project was recorded in the .SLN file has having a Physical Path of {site-name}\ when it should have been Websites\{site-name}\. Hand-editing the .SLN files to correct the PhysicalPath
properties of the websites corrected the problem.

I was able to solve this problem by closing VS2005 and then deleting the solution's .suo file. I then restarted VS2005 by double-clicking the .sln file and was able to add the other project to the solution.

Gary Davis

This solution worked for me in VS 2010 aswell.David Dikman, http://www.greycastle.se, Örebro, Sweden

Seems like some have had success with deleting .suo file, and some have not. It didn't work for me... so here's what I did (which DID work... you can try it). Note I am using TFS 2008 and VS 2008, and the problem project was a web project.

In your TFS Workspace for the failing solution, copy <SolutionName>.sln to <SolutionName>.xxxsln as a backup, just in case.

Edit your <SolutionName>.sln in Notepad.

Remove all lines from Project("{some GUID here}") =
... down to EndProject, and save.

If your solution was closed, open it.

If your solution was already open, go back to VS, it will indicate "Your file was edited outside VS"; tell it to reload from disk.

Magically you will have a solution but the project will not be there. Have no fear... continue:

Because I had references to other projects/DLLs, I had to add the references to those projects/DLLs. I suggest right-clicking the PROJECT, selecting Start Options, click References in the option tree at left, then click Add as needed on the right
panel.

Everything should now be fine. Test by right-clicking the solution in Solution Explorer and selecting Build All. Instead of receiving error message, it should build just fine.

I had this issue when I moved my entire project and renamed the parent folder. You may run into this issue if you move your solution and/or rename it. If you haven't moved or renamed your solution area then deleting the .suo file is the way to
go.

Solution:

- All you have to do is open the .sln file in notepad and fix all your "PhysicalPath" and "Project" Path.

Example: PhysicalPath = "\..\..\..\..\My_Project\MySite\" (OLD Path)

PhysicalPath = "\..\..\..\My_Project\ParentFolder\MySite\" (NEW Path)

Reopen your solution and now VS will know about all your solution files. Apparently, even VS 2010 is not smart enough to automatically recognize the location you are opening from and automatically fix all paths.

Tryed all of the proposed solutions, but the won't work. But this solution had a good hint for me. Instead of changing the path I deleted the whole project within the .sln file (also all references of it's GUID). Then I opend the .sln in VS (2010) and added
the project again.

Deleting the suo file fixed the problem. The suo file is now name xxx.v11.suo and is a hidden file. So to find it you will have to use the dir /A:H command. And delete it with del /A:H xxx.v11.suo command.