I’ve experienced an issue opening a previously saved MPP by Aspose. In this scenario, I only open the MPP File and set the constraint date to this day. I’ve attached the source and MPP file.
public void Case021()
{
using (var stream = File.Open(@"F:\Iniciativa Folgas Planejadas01-02-201715-59.mpp", FileMode.Open))
{
var project = new Project(stream);
project.RootTask.Children.First().Set(Tsk.ConstraintType, ConstraintType.StartNoEarlierThan);
project.RootTask.Children.First().Set(Tsk.ConstraintDate, DateTime.Now);
}
}
The code above throw the exception:
Object reference not set to an instance of an object.
at . (SplitPartCollection )
at . (DateTime , SplitPartCollection )
at . (DateTime )
at Aspose.Tasks.ResourceAssignment. (DateTime )
at Aspose.Tasks.Task. ()
at . ()
at . ()
at Aspose.Tasks.Task. ()
at Aspose.Tasks.Task. (Boolean )
at . (Task , DateTime )
at Aspose.Tasks.Task. [T]( , T )
at Aspose.Tasks.Task.Set[T](Key`2 key, T val)