Unable set percentage complete when resource assigned

Unable to set the percentage to 100 when resource is assigned to the task.


It always set to 99 percentage and actual finish date set to N/A

Aspose.Tasks.License lic = new License();
lic.SetLicense(@“Aspose.Total.lic”);
string newFile = @“blank.mpp”;
string resultFile = “C:\a\OutputMPP.mpp”;
Project project = new Project(newFile);
project.Set(Prj.StartDate, DateTime.Now);
Task task = project.RootTask.Children.Add(“Task1”);
//Set Task Duration
task.Set(Tsk.Duration, project.GetDuration(8, TimeUnitType.Hour));
task.Set(Tsk.Start, new DateTime(2015, 2, 9));
task.Set(Tsk.PercentComplete, 100);

#region [Set Resources]
Resource rsc1 = project.Resources.Add(“Resource 1”);
rsc1.Set(Rsc.Type, ResourceType.Work);
#endregion [Set Resources]

#region [Set Assignments]
ResourceAssignment assgn = project.ResourceAssignments.Add(task, rsc1);
assgn.Set(Asn.Start, new DateTime(2015, 2, 10, 8, 0, 0));
assgn.Set(Asn.Finish, new DateTime(2015, 2, 10, 17, 0, 0));
#endregion [Set Assignments]

project.Save(resultFile, Aspose.Tasks.Saving.SaveFileFormat.MPP);

Hi Sanjay,

Thank you for writing to Aspose Support team.

In order to reflect the correct value of % complete, please set the ActualStart date of the task as shown in the following code segment. Please try it at your end and share your feedback with us:

task.Set(Tsk.ActualStart, new DateTime(2015, 2, 9));


NOT WORKING!


Can you please give the right solution? I have attached the console project here. Very urgent.