I have the following code
var ws = vcs.GetWorkspace(wsName, vcs.AuthorizedUser);
However, ws.OwnerIdentifier
is null at this point. What I do next to get the value is:
ws.Update(new UpdateWorkspaceParameters { Computer = ws.Computer });
And then ws.OwnerIdentifier
is no longer null.
There must be a better way to obtain ws.OwnerIdentifier
in my scenario. Any ideas?
Our back-end is TFS 2017.
I can get the
ws.OwnerIdentifier
value correctly with the NuGet package Microsoft.TeamFoundationServer.ExtendedClient installed. Tried with Version 15.xxx and 14.xx, both worked.You need to specify the
wsName
with quotes: (See VersionControlServer.GetWorkspace Method (String, String))Below sample for your reference: