Wrong Task.ID is returned on reading MPP file (C# .NET)

I have a project file (created in MSP2013) that starts:

aspose.png (4.2 KB)

If I run this code with that project file:

foreach (Task task in project.SelectAllChildTasks())
   Console.WriteLine(task.Get(Tsk.Id) + " " + task.Get(Tsk.Name));

I get:

0 XXXXXXXXXXXXX NB Digital IF
1 Project Control Owners
2 Project PM Thru First Article (Planning / Staffing / Schedule / Tracking / Financials)
3 Project PM After First Article (Planning / Staffing / Schedule / Tracking / Financials)
4 Project PE After First Article (Technical Coordination)

The Tsk.Id field does not match the left-most column of the screenshot. Retrieving Task Ids from the same file via COM does return the expected numbers (i.e. “Project Control Owners” is Id 2).

Is there a way to find the row number displayed in Microsoft Project via Aspose?

@bbockius,

I have observed the information shared by you and request you to please first try using latest Aspose.Tasks for .NET 19.6.1 on your end. If there is still an issue then please share the source file along with working sample code reproducing the issue.

This is Aspose.Tasks v19.6.1, as retrieved via Nuget.
The source code necessary to reproduce is:

static MSProjectUtils()
{
    var license = new AT.License();
          license.SetLicense(Assembly.GetExecutingAssembly().GetManifestResourceStream("Resources.Aspose_Tasks_lic"));

    AT.Project project = new AT.Project(@"Scrubbed.mpp");
    foreach (AT.Task task in project.SelectAllChildTasks())
        Console.WriteLine(task.Get(AT.Tsk.Id) + " " + task.Get(AT.Tsk.Name));
}

Attached is the project file “Scrubbed.mpp”. Scrubbed.zip (932.8 KB)

The output I get is:

0 XXXXX - XXXXX NB Digital IF
1 Project Control Owners
2 Project PM Thru First Article (Planning / Staffing / Schedule / Tracking / Financials)
3 Project PM After First Article (Planning / Staffing / Schedule / Tracking / Financials)
4 Project PE After First Article (Technical Coordination)

The output I was expecting is:

0 XXXXX - XXXXX NB Digital IF
1
2 Project Control Owners
3 Project PM Thru First Article (Planning / Staffing / Schedule / Tracking / Financials)
4 Project PM After First Article (Planning / Staffing / Schedule / Tracking / Financials)
5 Project PE After First Article (Technical Coordination)

I’ll note that in the full project file there are many “blank” task lines, and all of them are skipped by Aspose, resulting in the Id being off by one more each time.

Thanks,
-Bruce

@bbockius,

We are able to reproduce this issue and it has been logged with ID TASKSNET-3331 for further investigation. You will automatically be informed here once we have more information to share.

The issues you have found earlier (filed as TASKSNET-3331) have been fixed in this update.