Hello @novotny,
We fixed your sample a little, please check it on you side
var l = new License();
l.SetLicense(@"testdata\Aspose.Tasks.lic");
Project project = new Project("EmptyProject.mpp")
{
CalculationMode = CalculationMode.None
};
project.Set(Prj.Calendar, Calendar.Make24HourCalendar(project.Calendars.Add("24 Hour")));
project.Set(Prj.StartDate, new DateTime(2018, 6, 12, 0, 0, 0));
project.Set(Prj.NewTasksAreManual, false);
Task t1 = project.RootTask.Children.Add("t1");
Task t2 = t1.Children.Add("t2");
t2.Set(Tsk.ConstraintType, ConstraintType.MustStartOn);
t2.Set(Tsk.ConstraintDate, new DateTime(2018, 6, 12, 0, 0, 0));
t2.Set(Tsk.Start, new DateTime(2018, 6, 12, 0, 0, 0));
t2.Set(Tsk.Finish, new DateTime(2018, 8, 13, 23, 59, 59));
Task t3 = t1.Children.Add("t3");
t3.Set(Tsk.ConstraintType, ConstraintType.StartNoEarlierThan);
t3.Set(Tsk.ConstraintDate, new DateTime(2018, 8, 14, 0, 0, 0));
t3.Set(Tsk.Start, new DateTime(2018, 8, 14, 0, 0, 0));
t3.Set(Tsk.Finish, new DateTime(2018, 9, 30, 23, 59, 59));
project.Recalculate();
project.Save(@"AsposeTasksTest.mpp", SaveFileFormat.MPP);
Resulting duration of t1 is 333 days which is the same as MS Project generates for this user scenario.