tfs sdk - TFS API - how to make sure Workspace.OwnerIdentifier is not null? -


i have following code

var ws = vcs.getworkspace(wsname, vcs.authorizeduser); 

however, ws.owneridentifier null @ point. next value is:

ws.update(new updateworkspaceparameters { computer = ws.computer }); 

and ws.owneridentifier no longer null.

there must better way obtain ws.owneridentifier in scenario. ideas?

our back-end tfs 2017.

i can ws.owneridentifier value correctly nuget package microsoft.teamfoundationserver.extendedclient installed. tried version 15.xxx , 14.xx, both worked.

you need specify wsname quotes: (see versioncontrolserver.getworkspace method (string, string))

var ws = vcs.getworkspace("wsname", vcs.authorizeduser); 

below sample reference:

using system; using microsoft.teamfoundation.versioncontrol.client; using microsoft.teamfoundation.client;  namespace _0912_getworkspaceidentifier {     class program     {         static void main(string[] args)         {             string collection = @"http://server:8080/tfs/defaultcollection";             var tfsserver = new uri(collection);             var tpc = new tfsteamprojectcollection(tfsserver);             var vcs = tpc.getservice<versioncontrolserver>();             var ws = vcs.getworkspace("lc0706-2", vcs.authorizeduser);             var idf = ws.owneridentifier;              console.writeline(idf);         }     } } 

enter image description here


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -