We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Document.UpdateFields causes InvalidOperationException because of infinite loop


I’m running into a InvalidOperationException because of a detected infinite loop when I call UpdateFieds on the first attached document. The same code works perfectly fine on the second attached document. Only difference between both files is that all the footnotes have been removed from the second one.

This is my code:

public void UpdateFields(string pathToDocument)
using (var stream = new MemoryStream(System.IO.File.ReadAllBytes(path))
var doc = new Document(stream);

stream.Seek(0, SeekOrigin.Begin);
doc.Save(“output.docx”, (SaveFormat)doc.OrginalLoadFormat);

I’m working with Aspose.Words for .NET Version 17.3.0.

Could you please tell me what’s my problem?

Hi there,

Thanks for your inquiry. We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-15160. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

The issues you have found earlier (filed as WORDSNET-15160) have been fixed in this Aspose.Words for .NET 17.5 update and this Aspose.Words for Java 17.5 update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.