Specific file fails to open with ToDouble error

I have a specific file from a customer that is failing when I call new Project(FileStream fs).

I am attaching the file. The exception is:

System.InvalidOperationException
HResult=0x80131509
Message=ToDouble: encountered value with length 26
Source=Aspose.Tasks
StackTrace:
at #=z4AxnZv2uxUG49sqOAOEpTQclucm7gjUdFA==.#=zJKb93lU=(ExtendedAttribute #=zkIs5tU0=, #=zHLy4dMEQfUf4VZnRByPfgFJMRCC6 #=zpXqZQ1s=)
at #=z4AxnZv2uxUG49sqOAOEpTQclucm7gjUdFA==.#=zWK1LexI=(ExtendedAttribute #=zkIs5tU0=, #=zHLy4dMEQfUf4VZnRByPfgFJMRCC6 #=zpXqZQ1s=, #=zjWjOfCTFPtpHd2FCm_328AmywBRvJoDyvgSRsGhS6L3r #=zesuT0rU=)
at #=zg6etbpEnNqzXwh_UEmbnVfv2IFec_rai0LXf5vI=.#=zxnnoMRe_8hXc(ExtendedAttribute #=zkIs5tU0=, #=zHLy4dMEQfUf4VZnRByPfgFJMRCC6 #=zr_0SktvhjkNh, #=zjWjOfCTFPtpHd2FCm_328AmywBRvJoDyvgSRsGhS6L3r #=zQPNbhfmhyjGJ)
at #=zg6etbpEnNqzXwh_UEmbnVfv2IFec_rai0LXf5vI=.#=zOUJ0jyk=(ExtendedAttributeCollection #=zPGe$KHo=, #=zjWjOfCTFPtpHd2FCm_328AmywBRvJoDyvgSRsGhS6L3r #=zQPNbhfmhyjGJ)
at #=zENnmUueceBVbDen6PHGHT3tFAiMNBYZu9bCGDXA=.#=z$oixWHCdzYb9(Task #=zgdhbAVU=, #=zHLy4dMEQfUf4VZnRByPfgFJMRCC6 #=z3aLBKYm1qfIU, #=zjWjOfCTFPtpHd2FCm_328AmywBRvJoDyvgSRsGhS6L3r #=zesuT0rU=)
at #=zENnmUueceBVbDen6PHGHT3tFAiMNBYZu9bCGDXA=.#=zOUJ0jyk=(Task #=zgdhbAVU=, #=zWOP$MXyZ2raS2pUWZ2nptPMc4uh0o0ft9Udb7Uc= #=zPxKx5p9tTrqC, #=zAQv81NL8oo4eUeAgdFbwjSaAhVEH0cDlrw== #=zMISY6U$$KGZc, IDictionary2 #=z$FkpQLDRu9RZqVKadg==) at #=zFp02eYqhBlcVZ5QclI8MhNK8Kb2ICz2Cb_d18Ss=.#=zRIpsRuE=(IDictionary2 #=zcCJlPriNaP4XBDC43g==)
at #=zl3xNskCTrY5aUDxBPePXpT5dvi5kRKDjzQ==.#=zOUJ0jyk=()
at #=zl3xNskCTrY5aUDxBPePXpT5dvi5kRKDjzQ==.#=zOUJ0jyk=(Project #=z6rXcgzU=, Stream #=zCjPTjAE=, LoadOptions #=z963gpVQm0dWs, #=z4e22_CT6C4D34Z_aue2u1Ac= #=zVJVXWZQ=)
at #=zsJGHdTCu3ik7vhijmFrAsus=.#=zOUJ0jyk=(Stream #=zCjPTjAE=, Project #=z6rXcgzU=)
at Aspose.Tasks.Project.#=zT9qyd_jNgIvB(Stream #=zCjPTjAE=, LoadOptions #=z963gpVQm0dWs)
at Aspose.Tasks.Project…ctor(Stream stream)
at Acumen.Fuse.Controller.Platforms.MSProject.MppFile2.GetProject(String fileName) in C:\Development\Acumen\main\code\ProjectAnalyzer\ProjectAnalyzer\Controller\Platforms\MSProject\MppFile2.cs:line 630
at Acumen.Fuse.Controller.Platforms.MSProject.MppFile2.OnOpen() in C:\Development\Acumen\main\code\ProjectAnalyzer\ProjectAnalyzer\Controller\Platforms\MSProject\MppFile2.cs:line 135
at Acumen.Fuse.Controller.Platforms.PlatformFile.Open(PlatformOpenMode openMode, CancellationToken cancellation, CancellationToken forcedError, CancellationToken forcedCrash) in C:\Development\Acumen\main\code\ProjectAnalyzer\ProjectAnalyzer\Controller\Platforms\PlatformFile.cs:line 378
at Acumen.Fuse.ViewModel.ProjectViewModel.ImportStart(Object sender, DoWorkEventArgs e) in C:\Development\Acumen\main\code\ProjectAnalyzer\ProjectAnalyzer\ViewModel\ProjectViewModel.cs:line 1972

This exception was originally thrown at this call stack:
#=z4AxnZv2uxUG49sqOAOEpTQclucm7gjUdFA==.#=zJKb93lU=(Aspose.Tasks.ExtendedAttribute, #=zHLy4dMEQfUf4VZnRByPfgFJMRCC6)
#=z4AxnZv2uxUG49sqOAOEpTQclucm7gjUdFA==.#=zWK1LexI=(Aspose.Tasks.ExtendedAttribute, #=zHLy4dMEQfUf4VZnRByPfgFJMRCC6, #=zjWjOfCTFPtpHd2FCm_328AmywBRvJoDyvgSRsGhS6L3r<#=zHLy4dMEQfUf4VZnRByPfgFJMRCC6>)
#=zg6etbpEnNqzXwh_UEmbnVfv2IFec_rai0LXf5vI=.#=zxnnoMRe_8hXc(Aspose.Tasks.ExtendedAttribute, #=zHLy4dMEQfUf4VZnRByPfgFJMRCC6, #=zjWjOfCTFPtpHd2FCm_328AmywBRvJoDyvgSRsGhS6L3r<#=zHLy4dMEQfUf4VZnRByPfgFJMRCC6>)
#=zg6etbpEnNqzXwh_UEmbnVfv2IFec_rai0LXf5vI=.#=zOUJ0jyk=(Aspose.Tasks.ExtendedAttributeCollection, #=zjWjOfCTFPtpHd2FCm_328AmywBRvJoDyvgSRsGhS6L3r<#=zHLy4dMEQfUf4VZnRByPfgFJMRCC6>)
#=zENnmUueceBVbDen6PHGHT3tFAiMNBYZu9bCGDXA=.#=z$oixWHCdzYb9(Aspose.Tasks.Task, #=zHLy4dMEQfUf4VZnRByPfgFJMRCC6, #=zjWjOfCTFPtpHd2FCm_328AmywBRvJoDyvgSRsGhS6L3r<#=zHLy4dMEQfUf4VZnRByPfgFJMRCC6>)
#=zENnmUueceBVbDen6PHGHT3tFAiMNBYZu9bCGDXA=.#=zOUJ0jyk=(Aspose.Tasks.Task, #=zWOP$MXyZ2raS2pUWZ2nptPMc4uh0o0ft9Udb7Uc=, #=zAQv81NL8oo4eUeAgdFbwjSaAhVEH0cDlrw==, System.Collections.Generic.IDictionary<int, Aspose.Tasks.Calendar>)
#=zFp02eYqhBlcVZ5QclI8MhNK8Kb2ICz2Cb_d18Ss=.#=zRIpsRuE=(System.Collections.Generic.IDictionary<int, Aspose.Tasks.Calendar>)
#=zl3xNskCTrY5aUDxBPePXpT5dvi5kRKDjzQ==.#=zOUJ0jyk=()
#=zl3xNskCTrY5aUDxBPePXpT5dvi5kRKDjzQ==.#=zOUJ0jyk=(Aspose.Tasks.Project, System.IO.Stream, Aspose.Tasks.LoadOptions, #=z4e22_CT6C4D34Z_aue2u1Ac=)
#=zsJGHdTCu3ik7vhijmFrAsus=.#=zOUJ0jyk=(System.IO.Stream, Aspose.Tasks.Project)

[Call Stack Truncated]
ProjectIssue.zip (2.1 MB)

@JamesPike

The error you’re encountering, System.InvalidOperationException: ToDouble: encountered value with length 26, indicates that there is an issue with the data being processed in the project file. This typically occurs when the data format in the file does not match the expected format for conversion to a double.

Here are a few steps you can take to troubleshoot and potentially resolve the issue:

  1. Check the Project File: Open the project file in Microsoft Project or a compatible application to inspect for any unusual values or corrupted data in the fields that are expected to be numeric.

  2. Validate Extended Attributes: The error stack trace suggests that the issue may be related to extended attributes. Ensure that any custom fields or extended attributes in the project file do not contain invalid data.

  3. Implement Error Handling: Surround the code that opens the project file with error handling to catch and log any exceptions. This can help you identify the specific attribute or data causing the issue.

  4. Contact Support: If the problem persists, consider reaching out to Aspose support with the project file for further assistance.

If you need more detailed guidance on handling project files with Aspose.Tasks, please refer to the official documentation.

I am reaching out to Aspose support. That is the point of my post. Please alert them to this post so they can provide support.

@JamesPike,
we were able to reproduce the issue.

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-11593

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.

1 Like