We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com



I have a performance problem when I include the links in the tasks.
I have the project with about three thousand tasks, and when I include the links, the process greatly increases the total execution time of the process.

In the
link = asposeProject.TaskLinks.Add (predecessor, successor, taskLink, lag);
that’s where the delay happens.

In a project with about 3,000 tasks the process ran for about 9 hours and did not end.

How can I improve this time by assigning the link?

Follow the code:

if (context.SyncConfig.SyncLigacoes && context.SyncConfig.SyncExportar)
Project asposeProject = context.AsposeData;
while (context.AsposeData.TaskLinks.Count > 0)

ChildTasksCollector collector = new ChildTasksCollector();
TaskUtils.Apply(asposeProject.RootTask, collector, 1);

asposeProject.CalculationMode = CalculationMode.Manual;

Dictionary<string, TaskLinkType> listLink = new Dictionary<string, TaskLinkType>();
listLink.Add("II", TaskLinkType.StartToStart);
listLink.Add("IF", TaskLinkType.StartToStart);
listLink.Add("FF", TaskLinkType.StartToStart);
listLink.Add("FI", TaskLinkType.StartToStart);

TaskLinkType taskLink;
Task predecessora;
Task sucessora;
Duration lag ;
TaskLink link;

foreach (PrjSyncTarefaRelac taskRelac in context.ProjetoTerceiro.TarefaRelacs)
	predecessora = PrjSyncTarefaUtils.getTaskObj(taskRelac.Predecessora);
	sucessora = PrjSyncTarefaUtils.getTaskObj(taskRelac.Sucessora);

	taskLink = (listLink.ContainsKey(taskRelac.TipoLigacao)) ? listLink[taskRelac.TipoLigacao] : TaskLinkType.FinishToStart;

	if (predecessora != null && sucessora != null)
		lag = asposeProject.GetDuration(RMSConvert.ToDouble(taskRelac.Defasagem), TimeUnitType.Day);
		link = asposeProject.TaskLinks.Add(predecessora, sucessora, taskLink, lag);
		link.LagFormat = TimeUnitType.Day;
asposeProject.CalculationMode = CalculationMode.Automatic;



It is requested to please provide sample project file so that we could investigate the issue in detail. You may share the file in private by sending in message. The message button shall appear by clicking on my user name.

1 Like

the project is attached.


We are unable to locate attached project file. You may share the file using GDrive or DropBox.

Follows the shared file link:


We do not have permission to download file at this link. Please provide open link so that any of us could access and download.

Here is the link to the shared file:


Thank you for providing the project file.
Initially, we have tried to check the performance issue and the output project file is successfully generated in 10 to 15 minutes.
We are working on this and shall update you as soon as we have more information to share.

In my environment the process has been running for more than 25 hours for 5000 tasks and has not finished generating the file.


Please let us know which OS, VS version and MS Project version is used to run this application.


Windows 7 Professional - Service Pack 1
Aspose.Tasks 2018 version 18.4


We have logged this issue under ID “TASKSNET-2789” for further investigation. You will automatically be informed here once we have more information to share.

Good Morning,
I downloaded version 18.10 of Aspose.Tasks.dll, and the process has the same behavior as version 18.4.


We are working on this issue and we will update you as soon as we have more information to share.

Hello @Helem,

Please try to set project calculation mode to CalculationMode.None and call project.Recalculate() when task links are already added.


You may use CalculationMode.None, please try the sample given below:

// save project calculation mode
var temp = project.CalculationMode;

project.CalculationMode = CalculationMode.None;

// the loop starts
// add 3000 links 
// the loop ends


// restore project calc mode
project.CalculationMode = tmp;

Furthermore, please feel free to write back to us if the issue persists or any additional information is required.