Every time I open my VS solution I get “Projects have recently been added to this solution. Do you want to get them from source control?”

后端 未结 4 531
北荒
北荒 2020-12-23 09:23

I don\'t know exactly how, but on a certain moment we ruined our complete visual studio solution. It wouldn\'t build anymore, nor clean, nor find any reference.

Afte

相关标签:
4条回答
  • 2020-12-23 09:33

    I had this same error. Turned out to be a project that was deleted from source control but still referenced in the .sln file. Was difficult to spot as we had >100 projects in the solution.

    0 讨论(0)
  • 2020-12-23 09:34

    This method is allot easier and less time consuming:

    1. Close the solution.
    2. Go the the folder which contains the solution file.
    3. Delete the hidden ".vs" folder.

    It won't do any harm but if you're afraid you can always rename the folder instead of deleting it.

    0 讨论(0)
  • 2020-12-23 09:41

    Thanks to some research and trying some various options this is what solved it in our case.

    1. Unbinding the solution file from TFS

    Unbind the solution file (.sln) from TFS. We did this (in visual studio of course) by going to the menu File => Source Control => Change Source Control.

    2. Cleaning the solution file by deleting globalsection

    We had to clean the solution file (.sln) by opening it in a text editor (we used notepad++). We removed all occurences of GlobalSection(TeamFoundationVersionControl) = preSolution. Including the mentioned starting tag and the ending tag EndGlobalSection.

    3. Bind the solution file to TFS again

    Finally we binded the solution file (.sln) to TFS again. We did this (in visual studio of course) by going to the menu File => Source Control => Change Source Control

    Thanks to http://www.nivisec.com/2008/09/vsts-projects-have-recently-been-added.html who pointed us in the right direction after some hours of research.

    0 讨论(0)
  • 2020-12-23 09:55

    Had a similar issue to this. There was a project file which was referenced and had been renamed. The .sln was not aware of the project file name change. The fix was the checkout the .sln file, and update the reference to the project file.

    0 讨论(0)
提交回复
热议问题