I'm trying to add a test run by the TFS API from excel.
In one of the field in the excel I got the user who executed the tests.
I want to update it in the server in order to update it I need to get the user as TeamFoundationIdentity
ims = _tfs.GetService<IIdentityManagementService>();
TeamFoundationIdentity UserID = ims.ReadIdentity(IdentitySearchFactor.DisplayName,
userName, ReadIdentityOptions.None);
Please help me to fix it.
Which version of Visual Studio and TFS are you using? I'm using TFS2010 and VS2010 and the following code worked fine for me:
IIdentityManagementService ims = (IIdentityManagementService)_tfs.GetService(typeof(IIdentityManagementService));
TeamFoundationIdentity UserID = ims.ReadIdentity(IdentitySearchFactor.DisplayName,"Mike" , MembershipQuery.Direct, ReadIdentityOptions.None);
Not sure if the problem is just the initialistation of IIdentityManagementService
, you could give it a try. I suspect that _tfs
is a valid representation of a TfsTeamProjectCollection
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With