Bug in Task Delete

Hi,


We implemented a module to manipulate MPP files. Therefore we need to delete some tasks within the plan using your task.delete method. Sometimes we get an exception from Task.Delete shown in the attached screenshot.

We are already using 16.11.1 with the Bugfix for extendedAttributes. Please see 2nd screenshot - the tasks in focus are not having a start, finish date - may be this causes your code to fail?

Please help?

thx
stefan


newT.[Set](Tsk.Start, refdate)’ threw an exception of type ‘System.ArgumentOutOfRangeException’
ActualValue: Nothing
Data: {System.Collections.ListDictionaryInternal}
HResult: -2146233086
HelpLink: Nothing
InnerException: Nothing
Message: “Der addierte oder subtrahierte Wert ergibt eine nicht darstellbare DateTime.” & vbCrLf & “Parametername: value”
ParamName: “value”
Source: “mscorlib”
StackTrace: " bei System.DateTime.AddTicks(Int64 value)" & vbCrLf & " bei System.DateTime.Add(Double value, Int32 scale)" & vbCrLf & " bei Aspose.Tasks.Calendar." & ChrW(2) & "(DateTime " & ChrW(2) & ", DateTime " & ChrW(3) & “, Calendar " & ChrW(5) & “)” & vbCrLf & " bei " & ChrW(15) & " .” & ChrW(2) & “(SplitPartCollection " & ChrW(2) & “)” & vbCrLf & " bei " & ChrW(15) & " .” & ChrW(2) & "(DateTime " & ChrW(2) & “, SplitPartCollection " & ChrW(3) & “)” & vbCrLf & " bei " & ChrW(15) & " .” & ChrW(3) & “(DateTime " & ChrW(2) & “)” & vbCrLf & " bei " & ChrW(14) & " .” & ChrW(5) & "(Task " & ChrW(2) & “, DateTime " & ChrW(3) & “)” & vbCrLf & " bei " & ChrW(15) & " .” & ChrW(3) & "(Task " & ChrW(2) & “, DateTime " & ChrW(3) & “)” & vbCrLf & " bei " & ChrW(6) & " .” & ChrW(2) & “(Task " & ChrW(2) & “)” & vbCrLf & " bei " & ChrW(5) & " .” & ChrW(2) & “(List1 " & ChrW(2) & ", " & ChrW(2) & " " & ChrW(3) & ")" & vbCrLf & " bei " & ChrW(6) & " ." & ChrW(2) & "()" & vbCrLf & </div><div>" bei " & ChrW(6) & " ." & ChrW(5) & " " & ChrW(2) & "()" & vbCrLf & " bei " & ChrW(5) & " ." & ChrW(5) & "​ " & ChrW(2) & "()" & vbCrLf & " bei Aspose.Tasks.Task." & ChrW(2) & "()" & vbCrLf & " bei Aspose.Tasks.Task." & ChrW(2) & "(Boolean " & ChrW(2) & ")" & vbCrLf & " bei " & ChrW(3) & " ." & ChrW(2) & " " & ChrW(3) & "(Task " & ChrW(2) & ", DateTime " & ChrW(3) & ")" & vbCrLf & " bei Aspose.Tasks.Task." & ChrW(5) & "[T](" & vbBack & " ​ " & ChrW(2) & ", T " & ChrW(3) & ")" & vbCrLf & " bei Aspose.Tasks.Task.Set[T](Key2 key, T val)”
TargetSite: {System.DateTime AddTicks(Int64)}

Hi Stefan,

Thank you for contacting Aspose support team.

This issue is not re-produced using tasks in MPP file with empty start/finish dates. Following code is used to re-produce the scenario.

Project proj = new Project(“sample.mpp”);
Task tsk = proj.RootTask.Children.GetById(2);
tsk.Delete();
proj.Save("output.mpp", SaveFileFormat.MPP);

Could you please share your sample MPP file along with the console application which can be compiled and executed here to re-produce the scenario? It will help us to observe the issue and provide assistance accordingly.