Problem with the example project

Apr 7, 2011 at 6:03 PM

Dear,

I will integrate my application with TFS, initially i would build my own tool based in TFS API. But searching more in web about this, i found your API.

I think its that i was searching. Then, i downloaded the source code and i tried run the example project.

After modify the serverURI(all right, tfs authenticated) i got the NullReferenceException:

On this code snippet: (_store is NULL)

public TfsProjectCollection Projects
{
get
{
return new TfsProjectCollection(_store.Projects);
}
}

 

Well,  when the application arrived here:

var projectController =
new ProjectController(
config,
serverController.GetAllProjects()[0]);

And the method "serverController.GetAllProjects" is called,  Before the call

private

TfsWorkItemStore _workItemStore;  

the value is null.

 

After the values is:

  _workItemStore {ZetaTfsApi.TfsWorkItemStore} ZetaTfsApi.TfsWorkItemStore
  base {ZetaTfsApi.TfsWorkItemStore} ZetaTfsApi.Base.BaseTfsObject {ZetaTfsApi.TfsWorkItemStore}
  _store null Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemStore
  CallingProcessIdentity 'this._workItemStore.CallingProcessIdentity' threw an exception of type 'System.NullReferenceException' string {System.NullReferenceException}
  CultureInfo 'this._workItemStore.CultureInfo' threw an exception of type 'System.NullReferenceException' System.Globalization.CultureInfo {System.NullReferenceException}
  FieldDefinitions 'this._workItemStore.FieldDefinitions' threw an exception of type 'System.NullReferenceException' ZetaTfsApi.TfsFieldDefinitionCollection {System.NullReferenceException}
  Projects 'this._workItemStore.Projects' threw an exception of type 'System.NullReferenceException' ZetaTfsApi.TfsProjectCollection {System.NullReferenceException}
  RegisteredLinkTypes 'this._workItemStore.RegisteredLinkTypes' threw an exception of type 'System.NullReferenceException' ZetaTfsApi.TfsRegisteredLinkTypeCollection {System.NullReferenceException}
  TeamFoundationServer 'this._workItemStore.TeamFoundationServer' threw an exception of type 'System.NullReferenceException' ZetaTfsApi.TfsTeamFoundationServer {System.NullReferenceException}
  UserDisplayMode 'this._workItemStore.UserDisplayMode' threw an exception of type 'System.NullReferenceException' ZetaTfsApi.TfsUserDisplayMode {System.NullReferenceException}

The first time that this method is executed, the _workItemStor isnt null:

 

public

TfsWorkItemStore WorkItemStore get

{

if (_workItemStore == null

)

{_workItemStore =

new TfsWorkItemStore return

(

(

WorkItemStore)tfs.GetService(typeof(WorkItemStore

)));

} 

_workItemStore;

}

}

and tfs.GetService was not called: Then the value of var _store is null.

Regards

{

 
Nov 12, 2013 at 7:47 PM
Yes, I get the same error even though the native TFS APIs work fine with the parameters I'm using.
Feb 4, 2014 at 4:08 PM
receiving the same errors. any word from the developer?