Project.Save() does not finish

I am encountering an issue where the Save method of the Project class enters an infinite loop when processing a specific file.

Upon investigation, I identified that the issue stems from formula localization. Because we are using the Portuguese version of Microsoft Project, empty dates are represented as “ND” (Não Disponível) rather than the standard “NA”. Changing these values to “NA” allows the file to save successfully; however, we need to maintain the Portuguese localization without manually altering formulas.

Additionally, I have been unable to reproduce this behavior in other files, which suggests there may be other underlying factors specific to this file contributing to the issue.

Code:

string fileName = "Path/To/File";
Project project = new(fileName);
string fileSave = "Path/To/Save";
project.Save(fileSave);

File:
infinity-save.7z (2,2,MB)

@pedrogcg

The behavior you describe is not expected – Project.Save should finish even when a formula contains the Portuguese “ND” token. To investigate further we need a reproducible sample and the exact environment details.

Please provide:

  1. Aspose.Tasks version you are using (e.g. 23.9, 24.1, etc.).
  2. Target framework / runtime (e.g. .NET 6, .NET Framework 4.8, .NET Core 3.1) and OS (Windows 10/11, Linux, etc.).
  3. The sample file that triggers the infinite loop (the 7‑z archive you attached). If the archive is large, a minimal project that reproduces the issue is sufficient.
  4. Any custom settings you apply to the Project object before calling Save (e.g., ProjectOptions, CalculationMode, etc.).

With those details we can reproduce the issue locally and log it as a defect. In the meantime, you can verify whether the problem persists with the latest Aspose.Tasks for .NET release; if it does, include the version number in your reply.

Aspose.Tasks version: 25.3.0 and 25.11.0
Target framework: .NET 8
OS: Windows 11

You’re right, the investigation’ve shown that issue is related to incorrect handling of “ND” literals in formulas.

@pedrogcg
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): TASKSNET-11629

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

@pedrogcg,
I’ve noticed that the formula is not calculated properly when the attached MPP is opened in MS Project on a machine with a non-Portuguese locale:

Screenshot_1.png

Is it suitable for your usage scenarios ?

Have you checked whether IsDate([%Date Field Name%]) operator can be used in your scenario instead of locale-specific ‘[%Date Field Name%]=ProjDateValue(“ND”)’ statement?

The #Error on non-portuguese is fine, i use in portuguese.

IsDate doesn’t seem a valid alternative because return true to any date value, including “ND”.