我試圖做一個實用與TFS工作,我從測試用例得到業主的價值和要改變它:如何獲取Microsoft.TeamFoundation.Framework.Client.TeamFoundationIdentity TFS API 2013?
var gss = Connection.ProjectCollection.GetService<IGroupSecurityService>();
Identity validUserSids = gss.ReadIdentity(SearchFactor.AccountName, "Team Foundation Valid Users", QueryMembership.Expanded);
Identity[] validUsers = gss.ReadIdentities(SearchFactor.Sid, validUserSids.Members, QueryMembership.None);
var owner = validUsers.FirstOrDefault(x => x != null && AccountName == "MyAccountName");
但是,當我在testCase.Owner
試圖設置owner
我得到一個錯誤:Cannot conver type "Microsoft.TeamFoundation.Server.Identity" to type "Microsoft.TeamFoundation.Framework.Client.TeamFoundationIdentity"
,投也給出了一個錯誤。
我怎樣才能得到Microsoft.TeamFoundation.Framework.Client.TeamFoundationIdentity
收集來設置字段中的值testCase.Owner
?