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

Free Support Forum - aspose.com

Getting text of a Node throws InvalidOperationException using C#


I changed version from Aspose.Words 9.5 to Aspose.Words 11.0
I use the same code that worked fine in 9.5 , but in 11.0 it is raising the exception:
"System.Message: System.InvalidOperationException: Stack Empty "…

The line that causes the exception looks like that :
Aspose.Words.NodeCollection runNodes = GetChildNodes();
for(i=o;i< runNodes.Count;i++)
string curText = runNodes[i].ToTxt();

when I use the .ToTxt() Method on vaild node I get wothout reason the “Stack Empty” Exception ,

Why does it happens and how can I solve this problem (Do you have a patch or new dll for it ? )

Help us urgently,

Thank you,
Leeor Chernov
.Net R&D Team

Hi Itay,

Thanks for your query. It would be great, If you share your document for investigation purposes and also share code for
GetChildNodes() method.

Meanwhile the code is on another machine that I cant copy ...
GetChildNodes() implementation:
return (currPar as Aspose.Words.Paragraph).GetChildNodes(NodeType.Run, true );

The purpose is to run on found paragraph by linq and then insert hyperlinks on requested nodes matching our conditions,

Is it enough for you to understand the problem or explain to me what can cause it , as I said it worked fine on version 9.5?


Hi there,

Thanks for your inquiry.

We are aware of this issue. Your request has been linked to the appropriate issue. We will inform you as soon as it is resolved.

In the mean time you can work around this issue by casting each node to a run and then using the run.Text property instead.


Hi there,

Good news, this issue is fixed in the current code base and will be available in the next release due out in the next couple of days.

We will inform you as soon as it’s released.


Thank you ,

Please send me notification for the fix in my account email ,
since I need it ASAP


Hi Itay,

I would like to inform you that the fix for this issue (WORDSNET - 4812) will be available in our upcoming monthly release due early next month. You’ll be notified via this forum thread within 36 hours.

Fix/Version: 11.1.0 - Feb 2012
Status: Closed
Resolution: Resolved

The issues you have found earlier (filed as WORDSNET-4812) have been fixed in this .NET update and this Java update.

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