Security Exception when I call server.GetService()


hi all,

when cal following codes

teamfoundationserver server = teamfoundationserverfactory.getserver(servername);
workitemstore store = (workitemstore)server.getservice(typeof(workitemstore));

a security exception has been thrown.

how can authenticat with special user or let server's iusr_myservername has right.

thanks.

 

stack trace:


[securityexception: tf50309: not have sufficient permissions perform operation.]
   microsoft.teamfoundation.proxy.bisregistrationproxy.getregistrationentries(string toolid) +55
   microsoft.teamfoundation.proxy.bisregistrationservice.refreshmemorycache() +83
   microsoft.teamfoundation.proxy.bisregistrationservice.refreshcachesifneeded(boolean direct) +75
   microsoft.teamfoundation.proxy.bisregistrationservice.getregistrationentries(string toolid) +15
   microsoft.teamfoundation.workitemtracking.client.workitemstore.getmiddletierurls(string& serverurl, string& configurationsettingsurl) +62
   microsoft.teamfoundation.workitemtracking.client.workitemstore.initializeinternal() +118
   microsoft.teamfoundation.workitemtracking.client.workitemstore.microsoft.teamfoundation.client.iteamfoundationserverobject.initialize(teamfoundationserver teamfoundationserver) +88
   microsoft.teamfoundation.client.teamfoundationserver.createitfsobjectinstance(type servicetype) +137
   microsoft.teamfoundation.client.teamfoundationserver.getservice(type servicetype) +241

 

teamfoundationserverfactory.getserver(servername) return tfs object logged on credentials. if want use different credentials, following:

teamfoundationserver tfs = new teamfoundationserver(servername, new networkcredentials(username, password, domain));
tfs.ensureauthenticated();
workitemstore store = (workitemstore) tfs.getservice(typeof(workitemstore)

-ravi


Archived Forums V  >  Team Foundation Server - General



Comments

Popular posts from this blog

Conditional formatting a graph vertical axis in SSRS 2012 charts

Register with Power BI failed

SQL server replication error Cannot find the dbo or user defined function........