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

69,352

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.

  1. Don't have the solution open when you delete the hidden .suo file.
  2. Restart VisualStudio.
  3. 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:

  1. Right click the project & Remove the "not loaded" or "unavailable" project
  2. Right click the solution & Add "Existing Project"
Share:
69,352

Related videos on Youtube

sineas
Author by

sineas

Updated on May 12, 2021

Comments

  • sineas
    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
      John Leidegren over 12 years
      Oh, how I hate TFS for giving me these headaches!
    • Claudius
      Claudius about 8 years
      Go down, you will find correct answer here.
  • sineas
    sineas over 14 years
    i 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
    sineas over 14 years
    dont have the Edit option. its only reload project, cut and remove.
  • sineas
    sineas over 14 years
    i 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
    sineas over 14 years
    BTW 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
    Jason Williams over 14 years
    In 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
    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
    Christer Berglund almost 12 years
    Don't forget to restart Visual Studio after deleting the .suo file
  • Torben Koch Pløen
    Torben Koch Pløen over 11 years
    Oh. 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
    Michael R about 9 years
    I could be wrong, but I don't think I even saw the .SUO file, until I closed VisualStudio.
  • Greg M.
    Greg M. over 8 years
    This also works in Visual Studio 2015, though the path to the .suo file has changed to <SolutionFolder>\.vs\<SolutionName>\v14\.suo.
  • wizloc
    wizloc over 8 years
    Just 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
    ckkkitty almost 8 years
    I'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
    crenshaw-dev over 6 years
    Ditto to ckkkitty. Had to remove .vs in '17.
  • thanos panousis
    thanos panousis about 6 years
    oh man. deleting the suo just made all the project reference problems I have been trying to solve for 3 hours, go away completely
  • Rafael
    Rafael almost 6 years
    Thanks! Opened the csproj files, on exit it asked to create/save a new .sln file and overwritten the old one!
  • Hopeless
    Hopeless almost 5 years
    I'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
    Nelssen over 4 years
    Worked for me in Visual Studio 2017!
  • tinonetic
    tinonetic about 4 years
    Worked for me Visual Studio 2019. Only that you delete the hidden .vs folder
  • Sarath Mohandas
    Sarath Mohandas almost 4 years
    Simple and straight... got it.
  • Hafiz Adewuyi
    Hafiz Adewuyi over 3 years
    The 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
    Prashant Tiwari about 3 years
    I 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
    Westley Bennett over 2 years
    Coming in 11 years later... why is this not selected as the correct answer???
  • l33t
    l33t over 2 years
    Coming in 11 years later... why hasn't Microsoft fixed this already? VS 2019 v16.11