Please try the following code to add new tasks and feel free to contact us in case you have further comments or questions.
Project project = new Project();<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
project.MinutesPerDay = 60 * 8;
//Add root task
Task root = new Task();
project.RootTask = root;
//Add child task
Task task = new Task("Task1");
task.ActualStart = DateTime.Parse("10-Aug-2011 9:00 AM");
//set duration in hours
task.Duration = new TimeSpan(24, 0, 0);
task.DurationFormat = TimeUnitType.Day;
//We need to recalculate the IDs only as UIDs were set correctly.
ProjectWriter writer = new ProjectWriter();
writer.Write(project, "project.xml", TasksDataFormat.XML);