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

Free Support Forum - aspose.com

Task Cost Calculation (Resource Based)

What is the best process for recalculating a Task Cost value?

I have sample project with two tasks, each associated with a Resource. If I programmatically change the Task durations, the cost is not being recalculated as I would have expected. It appears that the Cost and other resource related fields on the task are only updated if the Project is in CalculationMode = Auto at the time the change is made to the task.

We are working with large projects and for performance reasons, we are making changes to the project while it’s in Manual calculation mode.

    Project OriginalProject = new Project(@"C:\SingleTask.mpp") {

    var collector = new ChildTasksCollector();
    TaskUtils.Apply(OriginalProject.RootTask, collector, 0);

    OriginalProject.CalculationMode = CalculationMode.Manual;

    foreach (var tsk in collector.Tasks) {
        if (tsk.Get(Tsk.Uid) == 6) {
            tsk.Set(Tsk.Duration, OriginalProject.GetDuration(10, tsk.Get(Tsk.DurationFormat)));

Is there anyway to get these fields to recalculate without needing to be CalculationMode Auto at the time the change is made?

SingleTask.zip (27.0 KB)


We are investigating this on our end and we will share the feedback with you as soon as the investigation will be completed.


I have created an issue with ID TASKSNET-10282 in our issue tracking system as investigation to evaluate the requirements. This thread has been linked with the issue so that you may be notified once the issue will be addressed.