I have a very simple example to demonstrate the issue - please see attached Program.cs file.
The code generates a file called project.xml, which cannot be opened with MS Project for unknown reasons when using Aspose.Tasks version 6.4.0 (I think the issue is present in all version from 5.2.0 and up). The same code seems to be working with version 5.1.0.
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.
The issue with my original example seems to be with the ExtendedAttributeDefinition added to the project and the ExtendedAttribute added to each task. If I remove them - everything is ok. Can you please post an example how to use ExtendedAttributeDefinition and ExtendedAttribute?
Following is a sample code which demonstrates the usage of text ExtendedAttribute and ExtendedAttributeDefinition. Could you please give it a try and let us know your feedback?
Project prj = new Project(); ExtendedAttributeDefinition ead = default(ExtendedAttributeDefinition); ExtendedAttribute ea = default(ExtendedAttribute); Task task1 = prj.AddTask(“Test Task”);
foreach (Task task in prj.RootTask.Children) { task.ExtendedAttribute = new List(); ea = new ExtendedAttribute(); ea.FieldId = ead.FieldId; ea.Value = string.Format(“Description of ‘{0}’.”, task.Name); task.ExtendedAttribute.Add(ea); }