How can I regain access to my Team Foundation Serv

2019-03-20 07:27发布

问题:

I restarted IIS on our TFS server, and ever since then I haven't been able to access my workspace.

Regardless of what I do, it continually creates a workspace owned by a service account, and not my corporate account.

A couple days ago I had opened SSMS 2008 with "Run as different user" and used that service account. That's the only way I can think that it got in the picture.

So if I run tf workspaces /owner:* I see two workspaces, one owned by me, and one owned by the service.

When I open VS2010, it loads the workspace owned by the service account, and I can't view the other workspaces. Running tf /delete on the wrong one deletes it and running tf /remove:* clears my cache, but when I open VS2010, it is created again.

I tried running VS2010 with "Run as different user" and used my credentials, with no luck.

Anyone have any ideas as to how to get my workspace back??

回答1:

You can change the owner of a workspace using the /newowner flag to the tf workspace command. For example:

tf workspace /collection:http://server:8080/DefaultCollection workspaceName;oldOwner /newowner:newOwner

This should work as a stopgap measure to allow your old workspace to be owned by the service account. To update this, make sure that you do not have credentials saved for your TFS server in Control Panel -> Credential Manager. These credentials will always override your logged in user credentials or anything specified to runas.



回答2:

So, not an answer, but a workaround.

I set the actual workspace to public, and now I can at least load it.

I have no idea why VS/TFS thinks I am a service account.

EDIT: Turns out I had the service account credentials for the tfs server saved in Credential Manager. Removing the credentials and restarting VS2010 resolved the issue.