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"));
//oMPPPRoj.Recalculate();
//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);
}