Error when adding ResourceAssignment

Hi,


I’m having troubles when adding ResourceAssignment, because that function are recalculating the task’s dates to wrong data.

You can use attached source code to simulate the error.

Ps.: My task’s type is “Fixed Duration” and resouce’s type is “Material” but is still recalculating.

Thanks.
Maybe the error are because of Duration are not being correctly calculated. When I open saved file in MS Project the duration are empty.

In my tests the Aspose.Tasks are recalculating the start/end/duration different than MS Project. I tried to explain this in the simulation below (action and what are done)

Simulating in MS Project:
1 - Set start date to 20/2/15
1.1 - MS Project just set start date to 20/2/15
2 - Set finish date to 26/2/15
2.1 - MS Project set finish date to 26/2/15
2.2 - MS Project calculate and set Duration (5 days)
3 - Set duration to 8 days
2.1 - MS Project set duration to 8 days
2.2 - MS Project calculate and set finish date

Same example in Aspose.Tasks:
1 - Set start date to 20/2/15
1.1 - Tasks set start date to 20/2/15
1.2 - Tasks set finish date to 20/2/15
2 - Set finish date to 26/2/15
2.1 - Tasks set finish date to 26/2/15
2.2- Tasks set start date to 26/2/15
3 - Set duration to 8 days
2.1 - Tasks set duration to 8 days, but not save in file.
2.2 - Tasks calculate and set finish date, but start date was changed to finish date at step 2.

Hi Lucas,

We are sorry for the inconvenience caused to you.

The issue seems to occur due to resource assignments where tasks durations are set to zero. The issue has been logged as TASKS-33952 for further investigation by our product team. We’ll notify you here once there is some update available in this regard.

With respect to the tasks dates, if a task mode is set to Manual, all the properties need to be set manually. The following code sample sets the Task’s start, finish and duration as shown in the following sample code:

Sample Code:

Project project = new Project("New project 2010.mpp");

project.Set(Prj.NewTasksAreManual, true);

Task task = project.RootTask.Children.Add("Task 1");

task.Set(Tsk.IsManual, true);

task.Set(Tsk.ManualStart, new DateTime(2015, 02, 20, 8,0,0));

task.Set(Tsk.ManualFinish, new DateTime(2015, 02, 26, 17,0,0));

task.Set(Tsk.ManualDuration, project.GetDuration(5, TimeUnitType.Day));

project.Save("Manual.mpp", SaveFileFormat.MPP);

<w:LatentStyles DefLockedState=“false” DefUnhideWhenUsed=“true”
DefSemiHidden=“true” DefQFormat=“false” DefPriority=“99”
LatentStyleCount=“267”>
<w:LsdException Locked=“false” Priority=“0” SemiHidden=“false”
UnhideWhenUsed=“false” QFormat=“true” Name=“Normal”/>
<w:LsdException Locked=“false” Priority=“9” SemiHidden=“false”
UnhideWhenUsed=“false” QFormat=“true” Name=“heading 1”/>
<w:LsdException Locked=“false” Priority=“9” QFormat=“true” Name=“heading 2”/>
<w:LsdException Locked=“false” Priority=“9” QFormat=“true” Name=“heading 3”/>
<w:LsdException Locked=“false” Priority=“9” QFormat=“true” Name=“heading 4”/>
<w:LsdException Locked=“false” Priority=“9” QFormat=“true” Name=“heading 5”/>
<w:LsdException Locked=“false” Priority=“9” QFormat=“true” Name=“heading 6”/>
<w:LsdException Locked=“false” Priority=“9” QFormat=“true” Name=“heading 7”/>
<w:LsdException Locked=“false” Priority=“9” QFormat=“true” Name=“heading 8”/>
<w:LsdException Locked=“false” Priority=“9” QFormat=“true” Name=“heading 9”/>
<w:LsdException Locked=“false” Priority=“39” Name=“toc 1”/>
<w:LsdException Locked=“false” Priority=“39” Name=“toc 2”/>
<w:LsdException Locked=“false” Priority=“39” Name=“toc 3”/>
<w:LsdException Locked=“false” Priority=“39” Name=“toc 4”/>
<w:LsdException Locked=“false” Priority=“39” Name=“toc 5”/>
<w:LsdException Locked=“false” Priority=“39” Name=“toc 6”/>
<w:LsdException Locked=“false” Priority=“39” Name=“toc 7”/>
<w:LsdException Locked=“false” Priority=“39” Name=“toc 8”/>
<w:LsdException Locked=“false” Priority=“39” Name=“toc 9”/>
<w:LsdException Locked=“false” Priority=“35” QFormat=“true” Name=“caption”/>
<w:LsdException Locked=“false” Priority=“10” SemiHidden=“false”
UnhideWhenUsed=“false” QFormat=“true” Name=“Title”/>
<w:LsdException Locked=“false” Priority=“1” Name=“Default Paragraph Font”/>
<w:LsdException Locked=“false” Priority=“11” SemiHidden=“false”
UnhideWhenUsed=“false” QFormat=“true” Name=“Subtitle”/>
<w:LsdException Locked=“false” Priority=“22” SemiHidden=“false”
UnhideWhenUsed=“false” QFormat=“true” Name=“Strong”/>
<w:LsdException Locked=“false” Priority=“20” SemiHidden=“false”
UnhideWhenUsed=“false” QFormat=“true” Name=“Emphasis”/>
<w:LsdException Locked=“false” Priority=“59” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Table Grid”/>
<w:LsdException Locked=“false” UnhideWhenUsed=“false” Name=“Placeholder Text”/>
<w:LsdException Locked=“false” Priority=“1” SemiHidden=“false”
UnhideWhenUsed=“false” QFormat=“true” Name=“No Spacing”/>
<w:LsdException Locked=“false” Priority=“60” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Light Shading”/>
<w:LsdException Locked=“false” Priority=“61” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Light List”/>
<w:LsdException Locked=“false” Priority=“62” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Light Grid”/>
<w:LsdException Locked=“false” Priority=“63” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Shading 1”/>
<w:LsdException Locked=“false” Priority=“64” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Shading 2”/>
<w:LsdException Locked=“false” Priority=“65” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium List 1”/>
<w:LsdException Locked=“false” Priority=“66” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium List 2”/>
<w:LsdException Locked=“false” Priority=“67” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Grid 1”/>
<w:LsdException Locked=“false” Priority=“68” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Grid 2”/>
<w:LsdException Locked=“false” Priority=“69” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Grid 3”/>
<w:LsdException Locked=“false” Priority=“70” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Dark List”/>
<w:LsdException Locked=“false” Priority=“71” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Colorful Shading”/>
<w:LsdException Locked=“false” Priority=“72” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Colorful List”/>
<w:LsdException Locked=“false” Priority=“73” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Colorful Grid”/>
<w:LsdException Locked=“false” Priority=“60” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Light Shading Accent 1”/>
<w:LsdException Locked=“false” Priority=“61” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Light List Accent 1”/>
<w:LsdException Locked=“false” Priority=“62” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Light Grid Accent 1”/>
<w:LsdException Locked=“false” Priority=“63” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Shading 1 Accent 1”/>
<w:LsdException Locked=“false” Priority=“64” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Shading 2 Accent 1”/>
<w:LsdException Locked=“false” Priority=“65” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium List 1 Accent 1”/>
<w:LsdException Locked=“false” UnhideWhenUsed=“false” Name=“Revision”/>
<w:LsdException Locked=“false” Priority=“34” SemiHidden=“false”
UnhideWhenUsed=“false” QFormat=“true” Name=“List Paragraph”/>
<w:LsdException Locked=“false” Priority=“29” SemiHidden=“false”
UnhideWhenUsed=“false” QFormat=“true” Name=“Quote”/>
<w:LsdException Locked=“false” Priority=“30” SemiHidden=“false”
UnhideWhenUsed=“false” QFormat=“true” Name=“Intense Quote”/>
<w:LsdException Locked=“false” Priority=“66” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium List 2 Accent 1”/>
<w:LsdException Locked=“false” Priority=“67” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Grid 1 Accent 1”/>
<w:LsdException Locked=“false” Priority=“68” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Grid 2 Accent 1”/>
<w:LsdException Locked=“false” Priority=“69” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Grid 3 Accent 1”/>
<w:LsdException Locked=“false” Priority=“70” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Dark List Accent 1”/>
<w:LsdException Locked=“false” Priority=“71” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Colorful Shading Accent 1”/>
<w:LsdException Locked=“false” Priority=“72” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Colorful List Accent 1”/>
<w:LsdException Locked=“false” Priority=“73” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Colorful Grid Accent 1”/>
<w:LsdException Locked=“false” Priority=“60” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Light Shading Accent 2”/>
<w:LsdException Locked=“false” Priority=“61” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Light List Accent 2”/>
<w:LsdException Locked=“false” Priority=“62” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Light Grid Accent 2”/>
<w:LsdException Locked=“false” Priority=“63” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Shading 1 Accent 2”/>
<w:LsdException Locked=“false” Priority=“64” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Shading 2 Accent 2”/>
<w:LsdException Locked=“false” Priority=“65” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium List 1 Accent 2”/>
<w:LsdException Locked=“false” Priority=“66” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium List 2 Accent 2”/>
<w:LsdException Locked=“false” Priority=“67” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Grid 1 Accent 2”/>
<w:LsdException Locked=“false” Priority=“68” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Grid 2 Accent 2”/>
<w:LsdException Locked=“false” Priority=“69” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Grid 3 Accent 2”/>
<w:LsdException Locked=“false” Priority=“70” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Dark List Accent 2”/>
<w:LsdException Locked=“false” Priority=“71” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Colorful Shading Accent 2”/>
<w:LsdException Locked=“false” Priority=“72” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Colorful List Accent 2”/>
<w:LsdException Locked=“false” Priority=“73” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Colorful Grid Accent 2”/>
<w:LsdException Locked=“false” Priority=“60” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Light Shading Accent 3”/>
<w:LsdException Locked=“false” Priority=“61” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Light List Accent 3”/>
<w:LsdException Locked=“false” Priority=“62” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Light Grid Accent 3”/>
<w:LsdException Locked=“false” Priority=“63” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Shading 1 Accent 3”/>
<w:LsdException Locked=“false” Priority=“64” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Shading 2 Accent 3”/>
<w:LsdException Locked=“false” Priority=“65” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium List 1 Accent 3”/>
<w:LsdException Locked=“false” Priority=“66” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium List 2 Accent 3”/>
<w:LsdException Locked=“false” Priority=“67” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Grid 1 Accent 3”/>
<w:LsdException Locked=“false” Priority=“68” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Grid 2 Accent 3”/>
<w:LsdException Locked=“false” Priority=“69” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Grid 3 Accent 3”/>
<w:LsdException Locked=“false” Priority=“70” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Dark List Accent 3”/>
<w:LsdException Locked=“false” Priority=“71” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Colorful Shading Accent 3”/>
<w:LsdException Locked=“false” Priority=“72” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Colorful List Accent 3”/>
<w:LsdException Locked=“false” Priority=“73” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Colorful Grid Accent 3”/>
<w:LsdException Locked=“false” Priority=“60” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Light Shading Accent 4”/>
<w:LsdException Locked=“false” Priority=“61” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Light List Accent 4”/>
<w:LsdException Locked=“false” Priority=“62” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Light Grid Accent 4”/>
<w:LsdException Locked=“false” Priority=“63” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Shading 1 Accent 4”/>
<w:LsdException Locked=“false” Priority=“64” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Shading 2 Accent 4”/>
<w:LsdException Locked=“false” Priority=“65” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium List 1 Accent 4”/>
<w:LsdException Locked=“false” Priority=“66” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium List 2 Accent 4”/>
<w:LsdException Locked=“false” Priority=“67” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Grid 1 Accent 4”/>
<w:LsdException Locked=“false” Priority=“68” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Grid 2 Accent 4”/>
<w:LsdException Locked=“false” Priority=“69” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Grid 3 Accent 4”/>
<w:LsdException Locked=“false” Priority=“70” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Dark List Accent 4”/>
<w:LsdException Locked=“false” Priority=“71” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Colorful Shading Accent 4”/>
<w:LsdException Locked=“false” Priority=“72” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Colorful List Accent 4”/>
<w:LsdException Locked=“false” Priority=“73” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Colorful Grid Accent 4”/>
<w:LsdException Locked=“false” Priority=“60” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Light Shading Accent 5”/>
<w:LsdException Locked=“false” Priority=“61” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Light List Accent 5”/>
<w:LsdException Locked=“false” Priority=“62” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Light Grid Accent 5”/>
<w:LsdException Locked=“false” Priority=“63” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Shading 1 Accent 5”/>
<w:LsdException Locked=“false” Priority=“64” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Shading 2 Accent 5”/>
<w:LsdException Locked=“false” Priority=“65” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium List 1 Accent 5”/>
<w:LsdException Locked=“false” Priority=“66” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium List 2 Accent 5”/>
<w:LsdException Locked=“false” Priority=“67” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Grid 1 Accent 5”/>
<w:LsdException Locked=“false” Priority=“68” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Grid 2 Accent 5”/>
<w:LsdException Locked=“false” Priority=“69” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Grid 3 Accent 5”/>
<w:LsdException Locked=“false” Priority=“70” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Dark List Accent 5”/>
<w:LsdException Locked=“false” Priority=“71” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Colorful Shading Accent 5”/>
<w:LsdException Locked=“false” Priority=“72” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Colorful List Accent 5”/>
<w:LsdException Locked=“false” Priority=“73” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Colorful Grid Accent 5”/>
<w:LsdException Locked=“false” Priority=“60” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Light Shading Accent 6”/>
<w:LsdException Locked=“false” Priority=“61” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Light List Accent 6”/>
<w:LsdException Locked=“false” Priority=“62” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Light Grid Accent 6”/>
<w:LsdException Locked=“false” Priority=“63” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Shading 1 Accent 6”/>
<w:LsdException Locked=“false” Priority=“64” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Shading 2 Accent 6”/>
<w:LsdException Locked=“false” Priority=“65” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium List 1 Accent 6”/>
<w:LsdException Locked=“false” Priority=“66” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium List 2 Accent 6”/>
<w:LsdException Locked=“false” Priority=“67” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Grid 1 Accent 6”/>
<w:LsdException Locked=“false” Priority=“68” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Grid 2 Accent 6”/>
<w:LsdException Locked=“false” Priority=“69” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Medium Grid 3 Accent 6”/>
<w:LsdException Locked=“false” Priority=“70” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Dark List Accent 6”/>
<w:LsdException Locked=“false” Priority=“71” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Colorful Shading Accent 6”/>
<w:LsdException Locked=“false” Priority=“72” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Colorful List Accent 6”/>
<w:LsdException Locked=“false” Priority=“73” SemiHidden=“false”
UnhideWhenUsed=“false” Name=“Colorful Grid Accent 6”/>
<w:LsdException Locked=“false” Priority=“19” SemiHidden=“false”
UnhideWhenUsed=“false” QFormat=“true” Name=“Subtle Emphasis”/>
<w:LsdException Locked=“false” Priority=“21” SemiHidden=“false”
UnhideWhenUsed=“false” QFormat=“true” Name=“Intense Emphasis”/>
<w:LsdException Locked=“false” Priority=“31” SemiHidden=“false”
UnhideWhenUsed=“false” QFormat=“true” Name=“Subtle Reference”/>
<w:LsdException Locked=“false” Priority=“32” SemiHidden=“false”
UnhideWhenUsed=“false” QFormat=“true” Name=“Intense Reference”/>
<w:LsdException Locked=“false” Priority=“33” SemiHidden=“false”
UnhideWhenUsed=“false” QFormat=“true” Name=“Book Title”/>
<w:LsdException Locked=“false” Priority=“37” Name=“Bibliography”/>
<w:LsdException Locked=“false” Priority=“39” QFormat=“true” Name=“TOC Heading”/>
</w:LatentStyles>
<![endif]–><!–[if gte mso 10]>

/* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin-top:0in; mso-para-margin-right:0in; mso-para-margin-bottom:10.0pt; mso-para-margin-left:0in; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin;}

<![endif]–>

Hi Kashif,

The MS Project files attached were both created with Aspose.Tasks, using "start" or "ManualStart" (see file names).
The durations are being set empty even if using "ManualStart|ManualFinish|ManualDuration".
When using Manual ones the sumary dates are not being calculated automatically.

Talking about original error, you can see in console that the duration are not equals zero when adding a ResourceAssignment. That function that set duration to zero.
Can you give me an ETA on my issue?

Thanks.

Hi Lucas,

The issue has been logged too recently and it will take some time for our product team to analyze the issue and fix it. We’ll share the feedback with you once there is some information available in this regard.

Ok Kashif.

About the durations are being set to empty, even if using "ManualDuration", what i'm doing wrong?
Please check the MPP files attached.

Thanks.

Hi Lucas,


Could you please share your exact codes which are used to create the MPP files here? Please provide codes separately so that issue can be investigated and assistance can be provided.

Thank you for your patience and understanding in this regard.

Hi Kashif,


The zip file attached have MPP Files and program to create them.

Thanks.

Hi Lucas,


We are investigating this issue and will share the information soon with you. Thank you for your patience and understanding in this regard.
Hi Kashif,

Verifying this simulation data I found another problem.
The resource Units are not being set correctly at "ResouceAssignment.Add" method.
You can see this at line 114, because the ResourceAssignment's Unit are 1.0 even if the parameter in line 114 are 2.0, and when I saved that information to MPP the value saved is 0.

Sorry for insistence, but I need that corrections to proceed with my project and need some date to give to my managers.

Thank you for understanding.

Ps.: Thats the same simulation project, just adding a "console.writeln" to show a wrong data.

Hi Lucas,

While investigating the issue linked with this thread, we found two more issues as follow:

  1. TASKS-33955: MSP shows wrong Assignment Units for Material Resources
  2. TASKS-33954: Incorrect Manual Task data reading from MPP in 2010 Format
Both these issues have been investigated and fixed already.

With respect to the original bug logged against this thread i.e. TASKS-33952, we have investigated the issue and found that if we repeat the same steps using MSP, the task duration becomes zero i.e.
  1. Add 4 material resources in the MPP
  2. Make Assignments
You can see the result in the attached screenshot. Thus, we don’t think it is a bug at Aspose.Tasks API end.

Hi Kashif,


There’s two problems. The duration are being set to zero and final date being set to same as start date.

I think the problem is caused because the task’s duration always being set empty.
The duration issue was reported at thread “616180” in this post, with source atached ( Test_ProjectDates.zip ).
You simulated that?

Thanks.

Hi Lucas,

Yes, we did investigate that issue and found that if we open “ManualOutput.mpp” and “AutomaticOutput.mpp” both in MSP
2013, the duration of “Task 3” and “Task 4” are EMPTY. However in MSP
2010, these values are not empty. Further, if we open “ManualOutput.mpp” in MSP 2010, the summary tasks “Task 1”
and “Task 2” have duration 1 day whereas child tasks have duration 6
days.

These issues have already been logged as TASKS-33960 in our issue tracking system for further investigation by our product team. However, it is currently pending for investigation and we may not be able to provide a fix for this issue in the upcoming version. However, if there would be some work around code or a more accurate usage of the API, we’ll share the same here with you via this thread. We appreciate your patience until then.

The issues you have found earlier (filed as TASKS-33954;TASKS-33955;TASKS-33960) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.
Hi Kashif,

I've tested the version 8.2.0 but some issues are still occurring.
Please check attached source and MPP files.

TASKS-33960
Error: Duration set to Empty and Summary tasks duration not calculated automatically
Note: At version 8.2.0 the durations are not being set as empty, but are not being correctly calculated and the Summary dates are not being calculated.

TASKS-33954
Error:Manual Start and Manual Finish dates are read incorrectly for Manual task in mpp 2010 format
Note: If a resource assignment is added the dates are not being correctly calculated

TASKS-33952
Error: Resource Assignments change task duration to 0
Note: At version 8.2.0 the durations are not being set as zero, but are not being correctly calculated.

Thanks for regards.

Hi Lucas,

Thank you for writing to Aspose support team.

We have tested this issue at our end with the following sample code but there is no such issue observed. The dates appear to be same as per the code written. Could you please run this code at your end and let us know your feedback?

Sample Code:


Project project = new Project(@“Test_EmptyProject.mpp”);

project.CalculationMode = CalculationMode.Automatic;

project.Set(Prj.NewTasksAreManual, false);


Task tsk1 = project.RootTask.Children.Add(“Task 1”);

Task tsk2 = tsk1.Children.Add(“Task 2”);


project.Set(Prj.NewTasksAreManual, true);


Task tsk3 = tsk2.Children.Add(“Task 3”);

tsk3.Set(Tsk.IsManual, true);

tsk3.Set(Tsk.Start, new DateTime(2015, 2, 6, 9, 0, 0));

tsk3.Set(Tsk.Duration, tsk3.ParentProject.GetDuration(10, TimeUnitType.Day));


tsk3.Set(Tsk.ManualStart, tsk3.Get(Tsk.Start));

tsk3.Set(Tsk.ManualFinish, tsk3.Get(Tsk.Finish));

tsk3.Set(Tsk.ManualDuration, tsk3.Get(Tsk.Duration));


#region [Set Resources]

Resource rsc1 = project.Resources.Add(“Resource 1”);

rsc1.Set(Rsc.Type, ResourceType.Material);

Resource rsc2 = project.Resources.Add(“Resource 2”);

rsc2.Set(Rsc.Type, ResourceType.Material);

#endregion [Set Resources]


#region [Set Assignments]

project.ResourceAssignments.Add(tsk3, rsc1, 4);

project.ResourceAssignments.Add(tsk3, rsc2, 8);

#endregion [Set Assignments]


project.Recalculate();


project.Save(@“Output.mpp”, Aspose.Tasks.Saving.SaveFileFormat.MPP);

Hi,


Any news regarding item TASKS-33955 error?
I downloaded version 8.4 and the error persists.

Thanks.

Hi Anderson,


I have checked the status of this issue (TASKS-33955:MSP shows wrong assignment units for material resources) from our issue tracking system and it has been marked as fixed with Aspose.Tasks for .NET 8.2.0. Could you please make sure that you are using the latest version? If the issue still persists, please create a new post with your sample code and any sample file that we can check at our end and assist you further.

Hi Muhammad,


Thanks for the feedback.

I am using version 8.4.1.0.

Did tests with the code posted by Kashif, the file is created correctly, but our problem is the change and not in creation.

To create the file with Kashif code and then run the simple code below we can see the error:

Project project = new Project(@“Saved.mpp”);
Task tsk3 = project.RootTask.Children.First().Children.First().Children.First();
tsk3.Set(Tsk.Duration, tsk3.ParentProject.GetDuration(10, TimeUnitType.Day));
project.Save(@“Saved.mpp”, Aspose.Tasks.Saving.SaveFileFormat.MPP);

Thanks.

Hi Anderson,


I have tested the issue logged under Id: TASKS-33955 (MSP: Shows wrong assignment units for material resources) and observed that now units are not shown as 0 in MSP. The units are set to 5 and 3 for recurces Resource1 and Resource2 respectively.

Similarly, if we check the duration of task 3 after running the code mentioned above, the task duration is not set to 0.

Could you please elaborate what issue are you facing while using Aspose.Tasks for .NET 8.4.1? It is requested that please create new thread for any new issue, as it helps in keeping track of a single thread for a particular issue.