test.zip (25.5 KB)
my code is:
var project = new Project(“c:\test.mpp”);
var parent2 = project.SelectAllChildTasks().FirstOrDefault(t => t.Get(Tsk.Name) == “11991”);
var child12 = parent2.Children.Add(“11991 1”);
child12.Set(Tsk.Start, new DateTime(2019, 1, 4));
child12.Set(Tsk.Duration, project.GetDuration(1, TimeUnitType.Day));
the error only occurs if task 11991 has a pred, if I remove the predecessor from the file it doesn’t cause an error.