Confused with Resource Name retrieval in version 22.4

Hi,
We are trying to upgrade from aspose tasks version 19.3 to 22.4. When we instantiate the object from the template file, we have one resource which has no name.
image.png (10.2 KB)
Later in our code, we add four additional resources. As you can see, the first item in the collection is still unnamed.
image.png (8.7 KB)
We save this and it creates an .mpp file. The next time we try to create a version of the .mpp file, it will instantiate from the existing .mpp file and this time, when we look at the resource collection, items 0 and 1 have the same name.
image.png (9.4 KB)
Our code is trying to find and return resources by resource name. Returning item 0 results in the name being blank. I’m confused by a couple of things: 1) I’m confused at how the first two items got the same name. 2) Even though V/S shows item 1 name populated, when our mpp file gets created, we have lost the resource name and 3) This is different behavior than version 19.3. Version 19.3 keeps the first item unnamed. I have also attached the template file for reference.
WBSTemplate.zip (43.5 KB)

Here is the statement that we are using to find resources by name. Should we be using something else?
if (String.Compare(_projectResource.Get(Rsc.Name), _tradeGroup, true) == 0)

Thanks

@liesa.collier,

I’ve tried to reproduce the issue using ver. 22.4 and the following code based on your description:

string dir = "c:/";
Project p = new Project(dir + "WBSTemplate.mpp");
foreach (var r in p.Resources)
{
    Console.WriteLine("{0}, '{1}'", r.Get(Rsc.Uid), r.Get(Rsc.Name));
}

p.Resources.Add("Res1");
p.Resources.Add("Res2");
p.Resources.Add("Res3");
p.Resources.Add("Res4");

Console.WriteLine("=== Resources added ");
foreach (var r in p.Resources)
{
    Console.WriteLine("{0}, '{1}'", r.Get(Rsc.Uid), r.Get(Rsc.Name));
}

p.Save(dir + "temp.mpp");
var project2 = new Project(dir + "temp.mpp");

Console.WriteLine("=== Template saved and loaded");

foreach (var r in project2.Resources)
{
    Console.WriteLine("{0}, '{1}'", r.Get(Rsc.Uid), r.Get(Rsc.Name));
}

The output is

0, ''
===
0, ''
1, 'Res1'
2, 'Res2'
3, 'Res3'
4, 'Res4'
===
0, ''
1, 'Res1'
2, 'Res2'
3, 'Res3'
4, 'Res4'

Thus, I cannot observe the behavior you described.