Free Support Forum - aspose.com

Task splitting does not seem to work (C# .NET)

Hello,

I am generating an .mpp file using Aspose Tasks for .NET 19.10. It seems splitting task is not working anymore, could you please try ?

Thanks

@Opus_Team,

Can you please share source file along with sample code and generated result so that we may further investigate to help you out.

Code sample :

        Aspose.Tasks.Task currentTask = _project.RootTask.Children.Add("Task 1");
        currentTask.Set(Tsk.Start, new DateTime(2019, 10, 14, 08, 00, 00));
        currentTask.Set(Tsk.Duration, _project.GetDuration(6, TimeUnitType.Day));

        var splitResourceAssignment = _project.ResourceAssignments.Add(currentTask, null);
        splitResourceAssignment.TimephasedDataFromTaskDuration(_projectCalendar);

        var splitStartDate = new DateTime(2019, 10, 15, 17, 00, 00);
        var splitEndDate = new DateTime(2019, 10, 18, 8, 00, 00);
        splitResourceAssignment.SplitTask(splitStartDate, splitEndDate, _projectCalendar);

Please find attached the generated file.
Output.zip (23.3 KB)

Regards,

@Opus_Team,

We are working on this and will get back to you with feedback soon.

1 Like

@Opus_Team,

I have created an issue with ID TASKSNET-3586 in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be addressed.

Please attach the template MPP file you used to get _project initialized. And share the code of getting the “_projectCalendar” variable. We checked your code with our standard MPP template files for different MSP versions (2010. 2013, 2016) and can say that the split is presented in output MPP files.

Hello Alexander,

I’ve seen that you’ve closed the issue in Java version but not in .Net version.
I’ve tested again with version 20.1 and still having the issue even with the default template provided with this version.
However I found that disabling “RemoveInvalidAssignments” flag in MPPSaveOptions during file save fixes the issue :slight_smile:
Could you please tell me the relationship between splits and invalid assignments ?

@Opus_Team,

I have associated the issue in our issue tracking system and will share the feedback with you as soon as it will be shared.

Hello, @Opus_Team
We rechecked your scenario on the latest version Aspose Tasks 20.1 for .NET and didn’t reproduce the issue. Please check the GIF: https://tinyurl.com/thqznbz

Our main suggestion at the moment that you have no latest updates for MS Project installed, so it can be a cause why you’re facing with the issue.

Please, give us more details about your scenario and we will try to help you.