The project file has been moved renamed or is not on your computer
Solution 1
What typically helps to fix it is deleting the Solution User Options aka "SUO".
VS up to 2013
In the older VS it is stored as a "hidden" SolutionName.suo
in the same folder as the main .sln
file.
VS2015 or later
In VS2015 the same data was moved to a "hidden" .vs
folder under the same folder as the main .sln
file.
Solution 2
I just ran into this issue using VS 2013 after renaming a project. Stanley's answer guided me to the solution:
Close VS - delete .suo file - start VS again.
Solution 3
Delete the .suo file in a special way.
- Don't have the solution open when you delete the hidden .suo file.
- Restart VisualStudio.
- Open solution and Add project without error message.
Solution 4
TFS works like most source control packages: It remembers what it has put on your computer so that when you "Get Latest" it only has to get the chnages since your last "Get" instead of having to get absolutely everything.
This has one caveat: If you delete or rename the local files on your disk, TFS won't know that you have done this, and it will still think they are where it left them.
If you then "Get Latest" it will not bother to update the missing files.
You are then likely to get all kinds of "missing file" errors, from TFS and any other tools that look for the files.
To get around it, you need to:
- If you think you might have any changes in there that you don't want to lose, copy the source folder on your PC as a back up just in case!
- Right click on the project (in Solution Explorer) or folder (in Source Control)
- Choose "Get Specific Version" from the context menu
- Choose to get the "Latest Version" and tick the option that says (something like) "force get of files already in your workspace", which tells TFS to forget about what it "knows" and get all the files again anyway.
If you have any locally-changed (writable) files, then be careful. There is a second option that will overwrite these, losing your changes. But you have the backup, so you should be safe. It's generally better to tick this option as well to make sure that all your source code is completely up to date. (But obviously only if you don't mind losing any local changes!)
When you OK, this will forcibly get all the files in the project to your local drive, and should correct the problem.
Solution 5
Easiest option worked out for me is:
- Right click the project & Remove the "not loaded" or "unavailable" project
- Right click the solution & Add "Existing Project"
Related videos on Youtube
sineas
Updated on May 12, 2021Comments
-
sineas about 3 years
I get this error when I try to load a VS 2008 project from TFS source control:
The project file has been moved, renamed or is not on your computer
After I click OK the project says "unavailable". What is the problem? How do I resolve this? I never had this problem before. Some blogs said to delete the .suo file but I can't locate the .suo file. I deleted the entire project on my local computer so that the next time it opens it will create a new one, but I still get same error.
-
John Leidegren over 12 yearsOh, how I hate TFS for giving me these headaches!
-
Claudius about 8 yearsGo down, you will find correct answer here.
-
-
sineas over 14 yearsi tried to open the .vbproj file and this is what i get. "The selected file cannot be opened as a solution or project. Please select a solution file or a project file" also please put how to recreate the .sln file. I am new to this. thanks
-
sineas over 14 yearsdont have the Edit option. its only reload project, cut and remove.
-
sineas over 14 yearsi did "get specific version" and checked "overwrite all files even if local match server". no errors, but nothing came in. i checked from another computer and the project is in TFS and the other person can work fine on it.
-
sineas over 14 yearsBTW my local source folder is completely EMPTY. There is nothing in it. I deleted all files initially so that i could get all new ones. like opening a brand new project.
-
Jason Williams over 14 yearsIn that case, the next thing I would check would be your workspace mapping. In Team Explorer, double click the Source Control icon and at the top of the window that appears is a drop-down combo box. Drop this down and choose "add/edit workspaces". Edit your workspace and check that the TFS project containing your code has a corresponding folder on your local hard drive. And make sure you are looking at this folder when you try to load the solution. (Hint: Compare your setup to the other developer's which works to try to track down the source of the problem)
-
Richard Berg about 14 years+1. Very unfortunate error message -- it's actually most likely to arise when you've moved the files the "correct" way according to your SCC provider. (e.g. using 'tf rename' for TFS) Moving the project on disk w/o telling TFS, or forgetting to update a sln/csproj file, will result in different error messages in my experience. SUO files are opaque so you're left scratching your head until you do a tfpt treeclean / scorch.
-
Christer Berglund almost 12 yearsDon't forget to restart Visual Studio after deleting the .suo file
-
Torben Koch Pløen over 11 yearsOh. So now the .suo file is hidden. Why? Oh, I know why. We are developers and are obviously not capable of handling the added complexity with seeing the .suo file out in the open ;-)
-
Michael R about 9 yearsI could be wrong, but I don't think I even saw the .SUO file, until I closed VisualStudio.
-
Greg M. over 8 yearsThis also works in Visual Studio 2015, though the path to the .suo file has changed to <SolutionFolder>\.vs\<SolutionName>\v14\.suo.
-
wizloc over 8 yearsJust want to add - imperative that you close VS before deleting it. Deleting the file while VS is still open, then closing and reopening has NO effect. Must close first!
-
ckkkitty almost 8 yearsI'm also using VS 2015. As Greg M. noted, the SUO file is now in a hidden folder called .vs within the solution folder. I was able to fix the error by closing VS, deleting the entire .vs folder and reopening VS.
-
crenshaw-dev over 6 yearsDitto to ckkkitty. Had to remove .vs in '17.
-
thanos panousis about 6 yearsoh man. deleting the suo just made all the project reference problems I have been trying to solve for 3 hours, go away completely
-
Rafael almost 6 yearsThanks! Opened the csproj files, on exit it asked to create/save a new .sln file and overwritten the old one!
-
Hopeless almost 5 yearsI've tried this but still the same error, can't stand this stupid error (really a bug, I cannot accept this kind of nasty bug, extremely confusing).
-
Nelssen over 4 yearsWorked for me in Visual Studio 2017!
-
tinonetic about 4 yearsWorked for me Visual Studio 2019. Only that you delete the hidden
.vs
folder -
Sarath Mohandas almost 4 yearsSimple and straight... got it.
-
Hafiz Adewuyi over 3 yearsThe above comment from @wizloc did it for me. To solve the problem for me, I had to close all open instances of VS (Visual Studio), before deleting the .suo file. When I deleted the .suo file with VS instances still open, closing and opening the solution did not solve the problem for me. Also, it's worth adding that I got this issue while trying to add a new project to my solution.
-
Prashant Tiwari about 3 yearsI faced this issue when I renamed one of the projects and the solution as well. The solution loaded fine along with all projects except the one I renamed. Performing this fixed the problem.
-
Westley Bennett over 2 yearsComing in 11 years later... why is this not selected as the correct answer???
-
l33t over 2 yearsComing in 11 years later... why hasn't Microsoft fixed this already?
VS 2019 v16.11