Aspose Tasks 19.5 throws error while saving resource with zero units


Hello Team,
I tried to upgrade my application with Aspose Tasks 19.5 and getting below exception,

“Aspose.Tasks.TasksWritingException: 'Writing resource assignments started.
Writing assignment with UID=‘1’ started.
Writing assignment with UID=‘1’ finished.
Writing assignment with UID=‘2’ started.”

Sample code to reproduce the same

public static void CreateNewProjectFile1(string sPath)
string testTemplate = “2013ProjectTemplate.mpt”;//Use some project file
Project oMPPPRoj = new Project(sPath + testTemplate)
CalculationMode = CalculationMode.Manual
DateTime projectstartdate = Convert.ToDateTime(“03-Jul-2017”);
DateTime projectenddate = Convert.ToDateTime(“10-Jul-2017”);
oMPPPRoj.Set(Prj.StartDate, projectstartdate);
oMPPPRoj.Set(Prj.FinishDate, projectenddate);

		Aspose.Tasks.Task tsk = oMPPPRoj.RootTask.Children.Add("Task 1");
		DateTime tskstartdate = Convert.ToDateTime("05-Jul-2017");
		DateTime tskenddate = Convert.ToDateTime("07-Jul-2017");
		tsk.Set(Tsk.Start, tskstartdate);
		tsk.Set(Tsk.Finish, tskenddate);

        oMPPPRoj.ResourceAssignments.Add(tsk, oMPPPRoj.Resources.Add("TestRes1"));
        ResourceAssignment anResAssign = oMPPPRoj.ResourceAssignments.Add(tsk, oMPPPRoj.Resources.Add("AnResTest2"));


        //tsk.Set(Tsk.ConstraintType, ConstraintType.AsSoonAsPossible);
        //tsk.Set(Tsk.ConstraintDate, projectenddate);
        anResAssign.Set(Asn.Units, 0);

        oMPPPRoj.Save("SavedMPP.mpp", Aspose.Tasks.Saving.SaveFileFormat.MPP);




I have observed the issue shared by you and request you to please provide the source file used in sample code that we may use on our end to further verify the issue.


Can you confirm what source file you wanted, as I have already shared the complete code for reproducing the issue.



Please share files which you are loading in your sample code.

#5 (28.1 KB)
@Adnan.Ahmad PFA of mpt file used in my code.

Thank you.



Thank you for providing the source file. I have worked with sample code and source file shared and have been able to observe the issue on my end. An issue with ID TASKSNET-3297 has been created in our issue tracking system to investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.


The issues you have found earlier (filed as TASKSNET-3297) have been fixed in this update.


Is the issue resolved?

Please share source code along with dll , if issue is resolved.

I am nable to save new mpp file so.


Since we decide to go with 19.3 for our current release, didn’t tried the fix.
May be will update know I once try the latest dll.

Thank you.


Can i have your sample code along with dll which version you are using


I was trying to use 19.5 Aspose.Task.dll from, and sample code you can find from this support Aspose Tasks 19.5 throws error while saving resource with zero units



Can you please confirm if your issue is resolved?


I just verified the behavior with 19.7 Aspose.Task.dll and the behavior looks fine.

Thank you.



This issue has been resolved. You are very welcome.