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

后端 未结 15 1190
心在旅途
心在旅途 2020-12-22 20:49

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

相关标签:
15条回答
  • 2020-12-22 20:59

    I found it easiest to create a new Solution sln file.

    0 讨论(0)
  • 2020-12-22 20:59

    Sometimes, even though you changed .sln and .csproj path, and manually rename, you might forget to check the folder name that contains the project.

    0 讨论(0)
  • 2020-12-22 21:00

    Solution for this

    1. Again rename the project folder
    2. Set specific version & force get in TFS
    3. remove read only & hidden option in the latest folder (not the rename one)
    4. Now you can open the project without any issues
    0 讨论(0)
  • 2020-12-22 21:02

    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.

    0 讨论(0)
  • 2020-12-22 21:04

    I spent a lot of time for trying solve this problem. I did these steps : rename project, rename namespaces, rename project folder, edit .sln file, edit hidden .suo file. Project loaded but it was unrecognizable for TFS! Finally I found this guide.

    If you're using Resharper and TFVC is your version control, follow these steps :

    • Right-click the project in Solution Explorer, select Rename, and enter the new name

    • Right-click the project again and select Properties. Change the "Assembly name" and "Default namespace" on the Application tab.

    • Right-click the project again and select Refactor -> Adjust Namespaces. Accept the changes.

    • Change the AssemblyTitle and AssemblyProduct in Properties/AssemblyInfo.cs

    • Delete bin and obj directories in Windows Explorer

    • Open the Source Control Explorer and rename the project's directory. This will close the solution. Let it be closed.

    • Open the SLN file (with a text editor such as Notepad++) and change the path to the project (there should be multiple places).

    • Open the Solution again. Clean and Rebuild the project.

    0 讨论(0)
  • 2020-12-22 21:05

    Though it's well known VS defect, definately we can handle it!

    • Open the solution file in edit mode

    • Modify the relative path to match the modified/moved physical path ..

      SccProjectUniqueName1 = Source\\Order\\Order.csproj
      SccProjectName1 = Order.ApplicationService
      SccLocalPath1 = Order.ApplicationService
      
    • Also, makesure of correct relative path for the referring project(s)

      Project("{asdasd-301F-11D3-BF4B-asdasd}") = "Order",
              "Source\Order\Order.csproj", "{E25641BC-C990-40E2-8876-08AE8728F763}"
      EndProject
      
    0 讨论(0)
提交回复
热议问题