Dates and actual dates are changed after saving the file even after disabling the recalculation

When a file is open with aspose.tasks without doing anything the dates and actual dates are changed after saving the file even after disabling the recalculation.

//file opening :
public bool OpenMSP()
{
try
{
m_LogFile.Write("\n[" + DateTime.Now + "] " + "[INFO] " + "MSP File Openning start… : " + m_PathFile);
m_MSPFile = new Project(m_PathFile); //Ouvrir le fichier MSP
m_MSPFile.Recalculate(false);

//file closing
public bool saveMSP()
{
m_LogFile.Write("\n[" + DateTime.Now + “] " + “[INFO] " + “MSP Save in progress…”);
m_LogFile.Flush();
try
{
if (m_MSPFile == null)
m_LogFile.Write(”\n[” + DateTime.Now + “] " + “[ERROR] " + “m_MSPFile == null”);
else
{
m_PathFile += “.aspose.mpp”;
//m_MSPFile.Save(m_PathFile, Aspose.Tasks.Saving.SaveFileFormat.Mpp);
m_MSPFile.Save(m_PathFile);
m_LogFile.Write(”\n[” + DateTime.Now + "] " + "[INFO] " + “MSP File saving success…”);
m_LogFile.Flush();
return true;

Attached are two mpp file that show the issue.

Plannings.zip (57.9 KB)

@Vandenbussche,

I’ve opened the attached files using MS Project. Could you clarify which dates have changed?

Hello,

Please find a mpp where you can see the issue

Here’s a complete game that shows the recalculation problems encountered with the aspose library when the planners don’t want us to modify the schedule dates.

The treatment consists of simply opening the file (with recalculate set to false) and then saving it (no writing for this test).

Attached are the MPP files before and after opening via the aspose library.

If you open the file generated by aspose, you will already notice an error message on opening:

Sorry it is in French but we get this message

If we then compare the contents of the files, we see that some dates have been changed:

I have an environment that allows me to quickly test modifications.

The date format option doesn’t change anything in the final result

image005.png

Regards,

Judicael Vandenbussche

(Attachment OK ARRETS_GA23_PLANNING2- before saving.mpp is missing)

(Attachment OK ARRETS_GA23_PLANNING2.mpp.aspose - after saving.mpp is missing)

@Vandenbussche,
thank you for the very detailed issue description.

line

m_MSPFile.Recalculate(false);

doesn’t set recalculation to false. It calls recalculate with argument false, thus recalculating the project without validation.

See API Reference on the method Recalculate:

Could you check whether the issue can reproduced after removal of the line, please?

Hello,

Did you get a chance to look at the issue ?

Regards,

Judicael Vandenbussche

image001.png (18.9 KB)

image002.png (34 KB)

image003.png (7.46 KB)

image004.png (29.9 KB)

image005.png (4.61 KB)

@Vandenbussche,
have you tried to remove the line “m_MSPFile.Recalculate(false);” as I suggested in my previous message?