Free Support Forum - aspose.com

task.Successors always empty?

I am using the following code shown below to enumerate on the successors of any task. Unless I am doing something wrong, the successors collection of tasks is always empty. The predecessor is not empty. I realize I can use the predecessor collection but was curious as to an explanation. I have tried many different mpp files and no matter what, the successor list is empty. Any feedback you can provide?

Tasks tasks = asposeFile.AllTasks;
Aspose.Project.Relation relation;

System.Collections.IEnumerator iter = tasks.GetEnumerator();
while (iter.MoveNext() == true)
{
Aspose.Project.Task task = (Aspose.Project.Task)(iter.Current);

if (task != null && task.OutlineLevel > 0 && task.Successors != null)
{

for (int relationCount = 0;relationCount < task.Successors.Count;relationCount++)
{
relation = (Aspose.Project.Relation)task.Predecessors[relationCount];

Thanks,

Dan

Dear Dan,



Mpp file format has possibility to store both Predecessors and Successors but

if I’m not mistaken, MS Project use predecessors collection only to store information.