I have created as simple of a project as I can, yet the output seems to be useless. Here is the code I’m using:
License license = new License();
license.SetLicense(@“C:\Aspose.Total.lic”);
Project project = new Project();
Task task = new Task(“Added”);
task.Start = new DateTime(2009, 8, 1);
task.Finish = new DateTime(2009, 8, 5);
project.RootTask.Children.Add(task);
ProjectWriter writer = new ProjectWriter();
string path = @“C:\test.xml”;
using (FileStream fs = new FileStream(path, FileMode.Create, FileAccess.Write))
{
writer.Write(project, fs, TasksDataFormat.XML);
}
Seems simple enough, right? I’ve attached the resulting xml file. When I try to open it, it lets me select if I want to import “As a new project”, “Append the data to the active project”, and “Merge the data into the active project”. When I select the first, it just opens what seems to be a completely empty project. When I open up a new project, then select the second option, I get two milestone tasks that start on today’s date (the first one has no name, the second one has the “Added” name, and the duration is displayed in minutes). When I select the third option, I get the same result as the first. Am I doing something wrong here? Do I need a specific version of Project to view xml formatted projects? Here is my version: Microsoft Office Project 2007 (12.0.6423.1000) SP2 MSO (12.0.6554.5001). Thanks for any help you can provide.