Hello,
public ActionResult SetBaseLine() { using (Stream fs = new FileStream("C:/TestProject/DefaultProject.mpp", FileMode.Open)) { Project project = new Project(fs);<span style="color:blue;">var</span> task1 = project.RootTask.Children.Add(<span style="color:#a31515;">"Task 1"</span>); project.SetBaseline(<span style="color:#2b91af;">BaselineType</span>.Baseline, <span style="color:blue;">new</span>[] { task1 }); task1.Set(<span style="color:#2b91af;">Tsk</span>.Start, <span style="color:blue;">new</span> <span style="color:#2b91af;">DateTime</span>(2017, 2, 1)); project.SetBaseline(<span style="color:#2b91af;">BaselineType</span>.Baseline1, <span style="color:blue;">new</span>[] { task1 }); task1.Set(<span style="color:#2b91af;">Tsk</span>.Start, <span style="color:blue;">new</span> <span style="color:#2b91af;">DateTime</span>(2017, 2, 5)); project.SetBaseline(<span style="color:#2b91af;">BaselineType</span>.Baseline2, <span style="color:blue;">new</span>[] { task1 }); project.Save(<span style="color:#a31515;">"C:/TestProject/TestBaseLines.Mpp"</span>, <span style="color:#2b91af;">SaveFileFormat</span>.MPP); <span style="color:blue;">return</span> Content(<span style="color:#a31515;">"ok"</span>); }
}
Ps: I’m using ASP.NET MVC
Wating for reponse.