How to prevent “There appears to be a discrepancy

2019-03-10 16:34发布

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 changing the .sln file.

For some reason, any time I open a solution which has in the sln file:

SccTeamFoundationServer = http://servername:8080/tfs/defaultcollection
SccAuxPath* = http://servername:8080/tfs/defaultcollection

My copy of VSS insists on switching it to

SccTeamFoundationServer = http://servername:8080/tfs/
SccAuxPath* = http://servername:8080/tfs/

Saving these changes does fix everything for me, but everyone else using the same version control server is fine with the 1st version but not the second version. I wish for my computer's version control server/paths to be consistent with that of my coworkers.

Everyone is using Visual Studio 2010 with Visual Studio 2010 Team Explorer.

5条回答
看我几分像从前
2楼-- · 2019-03-10 16:47

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.

查看更多
干净又极端
3楼-- · 2019-03-10 16:53

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.

查看更多
男人必须洒脱
4楼-- · 2019-03-10 16:54

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
查看更多
闹够了就滚
5楼-- · 2019-03-10 16:58

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>
查看更多
Viruses.
6楼-- · 2019-03-10 17:01

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

查看更多
登录 后发表回答