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

Free Support Forum - aspose.com

Aspose.Words: ArgumentOutOfRangeException Specified argument was out of the range of valid values

Hi,

We are using Aspose Words v9.1 to generate Word documents. We are encountering intermittent ArgumentOutOfRangeException exceptions (see details below) when there is a high load on our server. Has this problem been reported to you by other customers ? Do you have any hints as to why we are having this issue ?

We intend to release to production very soon. A quick reply would be highly appreciated.

Thanks in advance for your reply.

Regards,

Shah

Type : System.ArgumentOutOfRangeException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Message : Specified argument was out of the range of valid values.
Parameter name: index
Source : Aspose.Words
ParamName : index
Data : System.Collections.ListDictionaryInternal
TargetSite : Void ?(Int32)
Stack Trace : at ?.?.?(Int32 ?)
at ?.?.WriteCore()
at ?.?.?(? ?)
at ?.?.?()
at ?.?.VisitRowEnd(Row row)
at Aspose.Words.Tables.Row.Accept(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.?(DocumentVisitor ?)
at Aspose.Words.Tables.Table.Accept(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.?(DocumentVisitor ?)
at Aspose.Words.Tables.Cell.Accept(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.?(DocumentVisitor ?)
at Aspose.Words.Tables.Row.Accept(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.?(DocumentVisitor ?)
at Aspose.Words.Tables.Table.Accept(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.?(DocumentVisitor ?)
at Aspose.Words.Body.Accept(DocumentVisitor visitor)
at ?.?.?(Section ?)
at ?.?.?()
at ?.?.?(? ?)
at Aspose.Words.Document.?(Stream ?, String ?, SaveFormat ?)
at Aspose.Words.Document.Save(Stream stream, SaveFormat saveFormat)
at ..


This message was posted using Aspose.Live 2 Forum

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. Could you attach the document you are getting issues with? Or does the problem occur with any document you try?

Also could you please try using the latest version of Aspose.Words 9.4.0. You can download this version here:

http://www.aspose.com/community/files/51/.net-components/aspose.words-for-.net/category1188.aspx

Best regards,

Hi,

Thanks for your quick reply.
We are using 2 document templates for generating Word documents. The exception we are getting, is not systematic. The generation of documents using these templates works fine. It's only when we try to generate an important number of documents at the same time, that we encounter exceptions.

We will try the latest version of Aspose Words on Monday and let you know if it solves our problem.

Regards,
Shah

Hi there,

Thanks for this additional information.

We will wait for your update on Monday. Please note that if this issue is still occuring it would be best to try create a sample project to reproduce it. Without this it will be very hard for us to diagnose the problem as we will be unable to reproduce it on our side.

Thanks,

Hello Adam,

While integrating the new version of Aspose.Words (v9.4), we met some breaking changes in the new API.

As we were already in staging, we preferred not to upgrade to the new version because we will not have enough time to evaluate the impacts of the upgrade.

Also, as we are using Microsoft BizTalk Server, documents which are not generated the first time, can be replayed and generated after initial errors. This makes our problem a non blocking issue for the moment.

We hope to use the new version of Aspose Words for our next product release.

Thanks again.

Kind regards,
Shah

Hi there,

Thanks for this additional information.

There were a few breaking changes to the API in Aspose.Words for .NET 9.2. You can find details and how to fix your code in migration article here.

Most were name changes and did not affect any internal functionality so you shouldn't have any issue in migrating to the new API.

Thanks,

Hi again,

I spent some time stress testing our code generating Word documents using templates and I’ve succeeded in reproducing the exceptions we were encountering in our staging environment.

For your information, I performed my load tests using Aspose.Words v9.4. The stacktrace (attached below), I got using this new version of Aspose.Words, is somewhat more detailed than the stacktrace I posted earlier. Because of Aspose code obfuscation, the stacktrace is semi encrypted and unfortunately, difficult to interpret for us. I hope that I will be more intuitive for you and that you will be able to give us hints on our problem.

Thanks you for your help.
Shah

Type : System.ArgumentOutOfRangeException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Message : Specified argument was out of the range of valid values.
Parameter name: index
Source : Aspose.Words
ParamName : index
Stack Trace :
à x6c95d9cf46ff5f25.x09ce2c02826e31a6.x7121e9e177952651(Int32 xc0c4c459c6ccbd00)
à x6c95d9cf46ff5f25.x09ce2c02826e31a6.x52b190e626f65140(Int32 xba08ce632055a1d9)
à xa604c4d210ae0581.xa55b88ee4e81381b.WriteCore()
à xa604c4d210ae0581.x485adbf5506556e8.x6210059f049f0d48(x7f77ea92be0d9042 x94aec03cf2ae750b)
à xa604c4d210ae0581.xa55b88ee4e81381b.x6210059f049f0d48(x1a78664fa10a3755 x062aae8c9613eeaa, x6ace28180a74825a xbd40d7ce3aca91e3)
à x9e260ffa1ac41ffa.x163859bfa28558c4.xfc53bd8a6982db4c()
à x9e260ffa1ac41ffa.x163859bfa28558c4.VisitRowEnd(Row row)
à Aspose.Words.Tables.Row.x3bbb475596fa1de1(DocumentVisitor x672ff13faf031f3d)
à Aspose.Words.CompositeNode.xf7ae36cd24e0b11c(DocumentVisitor x672ff13faf031f3d)
à Aspose.Words.Tables.Row.Accept(DocumentVisitor visitor)
à Aspose.Words.CompositeNode.x464d2134480a7bf2(DocumentVisitor x672ff13faf031f3d)
à Aspose.Words.CompositeNode.xf7ae36cd24e0b11c(DocumentVisitor x672ff13faf031f3d)
à Aspose.Words.Tables.Table.Accept(DocumentVisitor visitor)
à Aspose.Words.CompositeNode.x464d2134480a7bf2(DocumentVisitor x672ff13faf031f3d)
à Aspose.Words.CompositeNode.xf7ae36cd24e0b11c(DocumentVisitor x672ff13faf031f3d)
à Aspose.Words.Tables.Cell.Accept(DocumentVisitor visitor)
à Aspose.Words.CompositeNode.x464d2134480a7bf2(DocumentVisitor x672ff13faf031f3d)
à Aspose.Words.CompositeNode.xf7ae36cd24e0b11c(DocumentVisitor x672ff13faf031f3d)
à Aspose.Words.Tables.Row.Accept(DocumentVisitor visitor)
à Aspose.Words.CompositeNode.x464d2134480a7bf2(DocumentVisitor x672ff13faf031f3d)
à Aspose.Words.CompositeNode.xf7ae36cd24e0b11c(DocumentVisitor x672ff13faf031f3d)
à Aspose.Words.Tables.Table.Accept(DocumentVisitor visitor)
à Aspose.Words.CompositeNode.x464d2134480a7bf2(DocumentVisitor x672ff13faf031f3d)
à Aspose.Words.CompositeNode.xf7ae36cd24e0b11c(DocumentVisitor x672ff13faf031f3d)
à Aspose.Words.Body.Accept(DocumentVisitor visitor)
à x9e260ffa1ac41ffa.x163859bfa28558c4.x51ee56decc29a9da(Section xb32f8dd719a105db)
à x9e260ffa1ac41ffa.x163859bfa28558c4.x160a0bf4de8f6bd0()
à x9e260ffa1ac41ffa.x163859bfa28558c4.x8cac5adfe79bc025(x8556eed81191af11 x5ac1382edb7bf2c2)
à Aspose.Words.Document.xf381a641001e6830(Stream xcf18e5243f8d5fd3, String xafe2f3653ee64ebc, SaveOptions xc27f01f21f67608c)
à Aspose.Words.Document.Save(Stream stream, SaveOptions saveOptions)
à Aspose.Words.Document.Save(Stream stream, SaveFormat saveFormat)
à …

Hi there,

Thanks for this additional information.

I'm afraid it doesn't shed much light on what could be happening. In order to help we need to beable to reproduce the issue on our side. Could you please attach your template document and code that will allow us to reproduce it?

Thanks,

Hello,

Please find attached a sample Visual Studio solution which reproduces the problem. This sample has been built using Visual Studio Team Suite 2005. The stress testing has been done using Visual Studio Load Testing.

I have been able to reproduce the problem on my development machine which has the following configuration:

Software:
- Windows XP (the issue has also been reproduced on Windows Server 2003)
- .Net 3.0
- Visual Studio 2005 Team Suite

Hardware:
- Dual Core Processor 2.9 Ghz
- 2 GB of RAM

Thanks in advance for your help.

Kind regards,
Shah

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for additional information. Unfortunately, I cannot reproduce the problem on my side. I tried running your test in VS 2005 and 2008. Test is green in both cases.

Best regards,

Hello,

Please find attached a screenshot of our Stress Tests results. We are able to reproduce the problem on our machines.

I don’t know your machine configuration. It’s possible that the performance is too high to reproduce the problem. Could you please increase the ‘Step Load Pattern’ of the Visual Studio Load Tests (screenshot attached) ? May be configuring a higher load will help you reproduce the problem.

I stay at your disposal for any additional information.

Reards,
Shah

Hi there,

Thanks for your inquiry.

I'm afraid I was too unable to reproduce any issue on my side. Could you please try to narrow the source of the issue down further and we will have another try.

Thanks,