Rob H
Rob H

Reputation: 1849

TFS build workspace owner is not the Build Service account

I have a non-critical but annoying situation.

We have a server which has a set of TFS 2015 XAML build agents on it.

For some reason, there is a discrepancy between the Build Service "Run As" account and the build workspace owner.

The Build Service is set to our service account - let's call it TfsSvc. The build workspaces are all created with my account - let's call that RobH.

That would not have much of an effect, except that we use a gated check-in build. So, now, every check-in notification has my name on it:

If I open up Team Explorer in VS2015, I can see that it is connected to TFS as myself. I had the thought that maybe I should remove and re-add the server, but the Remove option is grayed out.

I saw a tip to remove TFS from the Windows Credential manager to force it to request your account info again. I did see that it have my (RobH) credentials stored there. However, removing them has had no effect.

I used the TFS Sidekicks tool to change the workspace owner manually, but that just made it mad - it threw an error saying that it couldn't create the workspace because one already existed for another user.

So, what else can I try? Any thoughts?

Upvotes: 0

Views: 732

Answers (2)

Angshuman
Angshuman

Reputation: 707

If i am understanding correct: you need to remove the workspace and recreate the workspace with the TfsSvc account. To do that do the below:

1 - unmapped all project

2 - Remove workspace

3 - delete the cache folder @: %localappdata%\Microsoft\Team Foundation\5.0\Cache

4 - remap project and Get Latest Version

This will remove the WorkSpace and you need to create new workspaces.

Upvotes: 0

PatrickLu-MSFT
PatrickLu-MSFT

Reputation: 51093

Check the build service properties (need to stop the service) enter image description here

If you set this with your account, just remove your user account here and leave the text box empty.


Update

Which workspace did you mean in your question?

If you mean the workspace in the build agent. It's weird, cause this workspace will created Automatically by Team Build. And we usually called it working directory. (Set in the Build Agent Properties) The build workspaces are all created with my account. How did you achieve this?

You can check this info in the mange workspaces dialog (Need VS). Moreover, the owner of this workspace will not effect which one checked in the changest .

To verify it, you can just delete the local workspace on the build agent (physically) and removed it from the TFS server. If you get XXX workspace not exist error, disable and enable the agent. Afterwards the correct identity was linked to the creation of shelvesets and the lookup of new automatically created workspace.

enter image description here

According to the information provided by you, the most suspicious is Checked in on behalf of Please double check your gated build definition and build logs. If there are some settings or info related to this.

And please also check the changest info. What's the result of the "by user" of your colleague's gated build?

enter image description here

Upvotes: 0

Related Questions