Console.WriteLine(“Press any ket to continue…”);
static public void Tasks_600558(String FileName, bool bWrite)
Project prj = new Project(FileName);
ChildTasksCollector collector = new ChildTasksCollector(); // Create a ChildTasksCollector instance
TaskUtils.Apply(prj.RootTask, collector, 1); // Collect all the tasks from RootTask using TaskUtils
foreach (Task tsk in collector.Tasks)
Console.WriteLine("Id = " + tsk.Get(Tsk.Id));
Console.WriteLine("Uid = " + tsk.Get(Tsk.Uid));
Console.WriteLine("Guid = " + tsk.Get(Tsk.Guid));
- Open your Projeto1.mpp file in Microsoft Project (MSP) 2010 and just save it back with some other name. Now open both the MPP files and you will observe that GUIDs are different.
- Open your Projeto1.mpp in MSP 2013 and save it with some other name. Now open the newly saved MPP file and you will observe that all the GUIDs are changed similar to the GUIDs in the image sent by you here. Sometimes all the GUIDs contain similar values which is completely wrong behavior.
- Open the Projeto1.mpp file using Aspose.Tasks and save it with some other name as shown in the above sample code. Open the saved file in MSP 2010 and you will see that all the GUIDs are maintained which is the expected behavior.
- Open the saved file by Aspose.Tasks in MSP 2013 and you will see entirely wrong GUIDs similar to the output in point 2 above.
Lucas Sepe:As you said, if I open a MPP file and save it in MS Project with "save" menu, the task's GUID are not recalculated.
Lucas Sepe:I just wanna do this with Aspose. How can I do this?
logged this issue in our issue tracking system for analysis by the
development team as TASKS-33937. You will be automatically notified, once any update is
available in this regard.
static void CheckGuidIssue()<o:p></o:p>
Project project = new Project("Projecto1.mpp");
ChildTasksCollector coll = new ChildTasksCollector();
TaskUtils.Apply(project.RootTask, coll, 0);
ExtendedAttributeDefinition customField =
project.ExtendedAttributes.FirstOrDefault(x => x.FieldId.Equals(ExtendedAttributeTask.Text10.ToString("D")));
if (customField == null)
customField = CreateCustomField();
customField.Alias = "Persistent GUID";
foreach (Task task in coll.Tasks)
ExtendedAttribute attr =
task.ExtendedAttributes.FirstOrDefault(x => x.FieldId.Equals(customField.FieldId));
if (attr == null)
attr = customField.CreateExtendedAttribute();
attr.Value = task.Get(Tsk.Guid);
private static ExtendedAttributeDefinition CreateCustomField()
ExtendedAttributeDefinition field = new ExtendedAttributeDefinition();
field.FieldId = ExtendedAttributeTask.Text10.ToString("D");
Your concerns are valid and we already have requested further information about the possible rectification of the issue via API. We’ll update you here as soon as some feedback is available in this regard.
Thank you for being patient in this regard.
Our product team has investigated this issue further. Unfortunately, the issue can’t be fixed in near future. One thing is that Task’s Unique ID (UID) is persistent when “Save As” options is used and the combination of this UID and project file path can be a primary key in client’s database. Thus, this combination can also be used to preserve the task uniqueness with both “save” and “save as” operation for any project file on the client machine and can be used as a workaround for this issue.
The issues you have found earlier (filed as ) have been fixed in this Aspose.Words for JasperReports 18.3 update.