Thank you for contacting Aspose support team.
Aspose.Tasks has simplified the process of project file creation and now there is no need to add root task, calendar, resource etc. Could you please try the following simple code which creates valid xml files? You may update it according to your requirements and let us know your feedback.
Project prj = new Project();
prj.StartDate = DateTime.Parse(“18-Aug-2009 8:00 AM”);
Task tsk1 = prj.AddTask(“Task1”);
tsk1.ConstraintType = ConstraintType.StartNoEarlierThan;
tsk1.Start = DateTime.Parse(“18-Aug-2009 8:00 AM”);
Task tsk2 = prj.AddTask(“Task2”);
tsk2.ConstraintType = ConstraintType.StartNoEarlierThan;
tsk2.Start = DateTime.Parse(“19-Aug-2009 8:00 AM”);
Resource res1 = prj.AddResource(“Resource1”);
ResourceAssignment ra1 = prj.AddResourceAssignment(tsk1, res1);
ResourceAssignment ra2 = prj.AddResourceAssignment(tsk2, res1);
//Save the Project