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);