I try to open, read and then write a mpp file.
First time, the file is well saved.
But if i try to re-open, re-read and re-write the same .mpp, then it crash, and write a 0 byte file, and the application freezes.
The Aspose Tasks component is the 220.127.116.11 for .net 3.5.
Here is my code sample :
string projectPath = “c:\temp\project.mpp”;
Project project = null;
ProjectReader mppReader = new ProjectReader();
using (Stream stream = File.OpenRead(projectPath))
project = mppReader.Read(stream);
ProjectWriter mppWriter = new ProjectWriter();
mppWriter.Write(project, projectPath, TasksDataFormat.MPP);
Project project2 = null;
ProjectReader mppReader2 = new ProjectReader();
using (Stream stream2 = File.OpenRead(projectPath))
project2 = mppReader2.Read(stream2);
ProjectWriter mppWriter2 = new ProjectWriter();
mppWriter2.Write(project2, projectPath, TasksDataFormat.MPP);