Search code examples
c#visual-studio-2010tfs-sdk

Object reference not set to an instance of an object.???


when i run to

 BranchHistoryTreeItem[][] TreeItem = vcs.GetBranchHistory(new ItemSpec[] { new                                     
 ItemSpec(teamProject.ServerItem, RecursionType.Full) }, LatestVersionSpec.Latest);

there are a issue "Object reference not set to an instance of an object." but BranchHistoryTreeItem[][] has declared TreeItem...


Solution

  • Its not the TreeItem which is null, it could be vcs or teamProject which is null. Put a break point and hover over vcs or teamProject and see which is null.