How to prevent “There appears to be a discrepancy between the solution's source control…” without changing the .sln file

后端 未结 5 861
伪装坚强ぢ
伪装坚强ぢ 2021-02-02 08:10

Note: I saw "There appears to be a discrepancy between the solution's source control ...." , but this doesn\'t apply, as I wish to fix this without changi

相关标签:
5条回答
  • 2021-02-02 08:25

    I had this problem with a Solution containing *.vcxproj project files, that were previously migrated from VS2008 to VS2010. The path to TFS was defined in both the .sln file and the .vcxproj files.

    The simplest fix was to update the *.vcxproj project files to use the SAK keyword.

    ie update from the format:

    <SccProjectName>$/MyProject/Directory/abc</SccProjectName>
    <SccAuxPath>http://servername:8080/tfs/defaultcollection</SccAuxPath>
    <SccLocalPath>.</SccLocalPath>
    <SccProvider>{11111111-1111-1111-1111-111111111111}</SccProvider>
    

    to

    <SccProjectName>SAK</SccProjectName>
    <SccAuxPath>SAK</SccAuxPath>
    <SccLocalPath>SAK</SccLocalPath>
    <SccProvider>SAK</SccProvider>
    
    0 讨论(0)
  • 2021-02-02 08:28

    Using Visual Studio you can solve this problem by unbinding and binding the solution and/or projects. Try this:

    1. Open the problem solution in VS (did this in VS2013 just now)
    2. Commit anything you need to commit (let's keep it simple - nothing to merge/checkin)
    3. If there are any pending changes then undo all pending changes to all the projects in that solution and any changes to the solution itself
    4. Go to File -> Source Control -> Advanced -> Change Source Control
    5. Select the problem projects and click "Unbind"
    6. Click OK and close the window (THIS IS IMPORTANT - if you don't click OK VS doesn't update the solution properly)
    7. Go to File -> Source Control -> Advanced -> Change Source Control
    8. Select all the projects you unbound in #5 and click "Bind"
    9. Click OK and close the window
    10. Check in your Solution & Project changes
    11. Close the solution and open it back up and everything should be fine now
    0 讨论(0)
  • 2021-02-02 08:43

    Have you tried connecting to http://servername:8080/tfs/defaultcollection instead of http://servername:8080/tfs/ in your Team Explorer settings - Team Project Connection? Try to do that, let someone who have the http://servername:8080/tfs/ version check-in, remap your local instance then get latest.

    0 讨论(0)
  • 2021-02-02 08:44

    I just had this exact problem. I finally solved the issue by disconnecting from TFS and reconnecting: In Team Explorer (View-Team Explorer), right-click on your TFS server name and click 'Disconnect'. Then click Team-Connect to Team Foundation Server...

    I did not have any pending changes when I did this. I would check in your code or at least shelve your changes before doing this to decrease the chance of losing work.

    The computer that this happened on had been working fine for over a year, but I guess Visual Studio somehow cached the name as http://servername:8080/tfs/ instead of http://servername:8080/tfs/defaultcollection and disconnecting and reconnecting to TFS reset VS to the correct path of http://servername:8080/tfs/defaultcollection. On my server (and I would guess on everyone's) http://servername:8080/tfs/ and http://servername:8080/tfs/defaultcollection point to the same thing. Raymund's solution didn't work for me - I had the same problem that Brian had with it.

    0 讨论(0)
  • 2021-02-02 08:48

    Also try opening the .sln file from Source Control Explorer, I think that may have been what solved the issue for me.

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