Error reading tasks from XER

@kashif.iqbal
I have read a XER file with 3 projetcs inside it.
When I get Tasks, it returns 88 tasks, but when I read TaskLinks it returns Links of tasks that belongs to other project.
Attached a file.
On linked tasks it returns ALL links from XER, but tasks only for first project.
errorRead.zip (161.1 KB)

@deliotomaz,

Could you please more elaborate the problem? If possible, please help us understand the issue at our end with the help of screenshots and your sample code.

@kashif.iqbal,
I have exported a XER file fromPrimavera. This file has 3 projects.
On XER files, Aspose not supoort to choose UID of project to import, so I just read the XER file.
When I run this code?
// Create project instance
Project prj = new Project(dataDir + “ReadTaskProperties.mpp”);

// Create a ChildTasksCollector instance
ChildTasksCollector collector = new ChildTasksCollector();

// Collect all the tasks from RootTask using TaskUtils
TaskUtils.Apply(prj.RootTask, collector, 0); 

I get 88 tasks. OK, this is the total of tasks from the first project in XER file.
When I run this code, to get the linked tasks:
project.TaskLinks

It returns links of tasks that are not in the 88 tasks returned above.
Debugging the UIDs os tasks I have found that it belongs to other projects in the same file.
An important thing. This projects inside XER don’t have relationship between them.

best

@deliotomaz,

When we open the project in PrimaveraReader, it shows the projects as in the attached screenshot. During execution, the API reads task links for project EC00630 and displays the parent project information which is also the same i.e. EC00630. Thus, we are unable to identify the problem at our end using the latest version of the API and following sample code:

Project project = new Project("errorread.xer");

Console.WriteLine("Project Name: " + project.Get(Prj.Name));
            
// Create a ChildTasksCollector instance
ChildTasksCollector collector = new ChildTasksCollector();

// Collect all the tasks from RootTask using TaskUtils
TaskUtils.Apply(project.RootTask, collector, 0);

Console.WriteLine("Total Tasks Count: " + collector.Tasks.Count);

Console.WriteLine("Total Task Links: " + project.TaskLinks.Count);

foreach (TaskLink link in project.TaskLinks)
{

    Console.WriteLine(link.PredTask.ParentProject.Get(Prj.Name) + "." + link.PredTask.Get(Tsk.Name));

    Console.WriteLine(link.SuccTask.ParentProject.Get(Prj.Name) + "." + link.SuccTask.Get(Tsk.Name));

    Console.WriteLine("*********************");

    Console.ReadLine();
}

In order to investigate the issue further, could you please help us identify a single Task link that exhibits the behavior you have mentioned? Your sample code for this illustration will help us reproduce the problem at our end and investigate it further.Projects.png (12.0 KB)