Connect to TFSAdministrationTool Proxy in asp.net

Topics: For TFSAdmin Developers, For TFSAdmin Users
Sep 30, 2011 at 9:20 PM

Is there a way to connect to

TFSAdministrationTool.Proxy.ITeamFoundationServerProxy
  in Asp.net?  I keep failing.

I can do it in WPF but not asp.net.

I set deny anonymous and impersonate = true in the web.config but when I get to SelectTeamProject I get a NULL failure. I'm assuming that the System.Collections.ListDictionaryInternal is null.

     string TfsCollectionURL = "http://tfsServerName.domain.com:8080/tfs/defaultcollection";      TFSAdministrationTool.Proxy.ITeamFoundationServerProxy iTFSProxy = TFSAdministrationTool.Proxy.TeamFoundationServerProxyFactory.CreateProxy();
    NetworkCredential n=  System.Net.CredentialCache.DefaultNetworkCredentials;      iTFSProxy.Connect(new Uri(TfsCollectionURL), n);      iTFSProxy.SelectTeamProject("ProjectName");



System.NullReferenceException was unhandled by user code
  Message=Object reference not set to an instance of an object.
  Source=TFSAdministrationTool.Proxy
  StackTrace:
       at TFSAdministrationTool.Proxy.TeamFoundationServerProxy.SelectTeamProject(String name) in D:\Work\TFSAdmin\Main\src\TFSAdministrationTool.Proxy\TeamFoundationServerProxy.cs:line 493
       at WebApplication2._Default.Button1_Click(Object sender, EventArgs e) in c:\users\117250.win\documents\visual studio 2010\Projects\WebApplication2\WebApplication2\Default.aspx.cs:line 44
       at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
       at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
       at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
       at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
       at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
  InnerException: