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

Free Support Forum - aspose.com

Error on add resource with 0 units to parent task

I have found an error when I add a new resource to a parent task. The resource assignment should has 0 units and 0 days of work.

This error did not occur when I’ve had the same resource with 0 units and 0 days of work to a non-parent task.

We upgraded the assembly version of Aspose.Tasks from 17.3 to 17.7. This error didn’t occur in Aspose Tasks 17.3, but occurs on 17.7.

The upgrade from 17.3 to 17.7 is very important to us, since the new version solves at least 5 problems reported by our customers.

Error_Add_Resource_To_Parent_Tasks.mpp.mpp.zip (29.5 KB)

public void Error_Add_Resource_To_Parent_Tasks()
{
	using (var stream = LoadFromAssembly("Error_Add_Resource_To_Parent_Tasks.mpp"))
	{
		var project = new Project(stream);
		project.CalculationMode = CalculationMode.None;

		/*
		 * First try: add resource R1 to task #1
		 */
		var task1 = project.RootTask.Children.GetById(1);

		var resource1 = project.Resources.Add("R1");
		resource1.Set(Rsc.Code, 1110000000000.ToString());

		var atualAssignment = project.ResourceAssignments.Add(task1, resource1, 0);

		atualAssignment.Set(Asn.Units, 0);
		atualAssignment.Set(Asn.Work, new Duration());

		// Ok, it works!
		project.Recalculate();
		
		/*
		 * Second try: add resource R2 to parent task #2
		 */
		var task2 = project.RootTask.Children.GetById(2);

		var resource2 = project.Resources.Add("R2");
		resource2.Set(Rsc.Code, 1110000000000.ToString());

		var atualAssignment2 = project.ResourceAssignments.Add(task2, resource2, 0);

		atualAssignment2.Set(Asn.Units, 0);
		atualAssignment2.Set(Asn.Work, new Duration());

		// Not ok. Throws a error!
		project.Recalculate();
	}

}

@siteware,

We are looking into this issue for further analysis at our end and will soon share our feedback with you here. We appreciate your patience in this regard.

@siteware,

Thank you for writing to Aspose support team again.

This issue is reproduced and logged under Id:TASKSNET-2055 for further investigation by the product team. You will be automatically notified once any update is received in this regard.

@siteware,

This issue has been fixed in the latest release of Aspose.Tasks for .NET 17.8. Please feel free to write to us in case of any further query in this regard.

The issues you have found earlier (filed as ) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan