Free Support Forum - aspose.com

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

Dear Sir

We encountered the internal error raised from the Aspose.word components occasionally as bellow ,could you give the advice to handle it .

We can re-produce this problem easily by bellow steps

1. build a method to process the Word document opening by Aspose.Word Component like as replacing some char at a few charapters in Document Content , then save the doucment to hard disk .

2 .start up over 10 threads , each thread runs the procedure above .

here is the envirement

Aspose.Word Ver. is 9.4

Windows2003 Enterprice x86

Visual Studio 2008

============================================

ystem.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: index
at x6c95d9cf46ff5f25.x09ce2c02826e31a6.x7121e9e177952651(Int32 xc0c4c459c6ccbd00)
at x6c95d9cf46ff5f25.x09ce2c02826e31a6.x52b190e626f65140(Int32 xba08ce632055a1d9)
at xa604c4d210ae0581.xa55b88ee4e81381b.WriteCore()
at xa604c4d210ae0581.x485adbf5506556e8.x6210059f049f0d48(x7f77ea92be0d9042 x94aec03cf2ae750b)
at xa604c4d210ae0581.xa55b88ee4e81381b.x6210059f049f0d48(x1a78664fa10a3755 x062aae8c9613eeaa, x6ace28180a74825a xbd40d7ce3aca91e3)
at x9e260ffa1ac41ffa.x163859bfa28558c4.xfc53bd8a6982db4c()
at x9e260ffa1ac41ffa.x163859bfa28558c4.VisitRowEnd(Row row)
at Aspose.Words.Tables.Row.x3bbb475596fa1de1(DocumentVisitor x672ff13faf031f3d)
at Aspose.Words.CompositeNode.xf7ae36cd24e0b11c(DocumentVisitor x672ff13faf031f3d)
at Aspose.Words.Tables.Row.Accept(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.x464d2134480a7bf2(DocumentVisitor x672ff13faf031f3d)
at Aspose.Words.CompositeNode.xf7ae36cd24e0b11c(DocumentVisitor x672ff13faf031f3d)
at Aspose.Words.Tables.Table.Accept(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.x464d2134480a7bf2(DocumentVisitor x672ff13faf031f3d)
at Aspose.Words.CompositeNode.xf7ae36cd24e0b11c(DocumentVisitor x672ff13faf031f3d)
at Aspose.Words.Body.Accept(DocumentVisitor visitor)
at x9e260ffa1ac41ffa.x163859bfa28558c4.x51ee56decc29a9da(Section xb32f8dd719a105db)
at x9e260ffa1ac41ffa.x163859bfa28558c4.x160a0bf4de8f6bd0()
at x9e260ffa1ac41ffa.x163859bfa28558c4.x8cac5adfe79bc025(x8556eed81191af11 x5ac1382edb7bf2c2)
at Aspose.Words.Document.xf381a641001e6830(Stream xcf18e5243f8d5fd3, String xafe2f3653ee64ebc, SaveOptions xc27f01f21f67608c)
at Aspose.Words.Document.Save(String fileName, SaveOptions saveOptions)
at Aspose.Words.Document.Save(String fileName)

===============================

Hi,

Thanks for your query. Aspose.Words component does support multi-threading and you can use your method mentioned in point number 1 with multiple threads. The only thing you need to make sure is that you always use separate Document instances per each thread. One thread should use one Document object. Please update your code (One thread for one Document). If you still face problem, please share your documents along with code for investigation purposes.

Dear Sir

Thanks for you answer , we copied one new report to process the content in it for each thread , we didn't reproduced this problem after used the new component which version is 10.5 .

Hi,

It is nice to hear from you that you have resolved your issue. Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.

Dear Sir

We knew the new version can solve the problem but our team can not convince the customer to update the component for the new version is not free , so we wonder how can we avoid of the problem by using current version or how can we get the component of Aspose.Word that had fixed this bug withou any charge .

Hi,

Thanks for your query. Unfortunately, we do not provide patches or hot fixes for old version of Aspose products. The only way to get a fix is upgrading to the newest versions. Please note that every new release of Aspose.Words comes up with some new features, enhancements in the existing features and bug fixes. Please use the latest version of Aspose.Words for .NET.

Dear Sir

In recent days, we found a issue about the Apose.Word, in our current system, we are using Web service to call the Aspose.word to converting/generating the MS - office document, then the user downloads these document from server. but in recent days we errors (See below) , we had to re-start the iis to sove this problem ,it seems the component of Aspose.Word cause the .net framework works un-normally .

Now we have two questions about this issue:<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

1. Did any other user find the same issue when they use Aspose.word version 9.4, has this issue been fixed in new version? it seems it is a defect that the Index was outside the bounds of the array when it was dealing with multi-threads calls.

2. If this issue is never reported by other users before, May I get a trial version? for eg. 30 days trial version, so that we can do a compare and persuade the company to buy the new license and upgrade it to the latest version.

Hope could get your early reply about both these two questions, thank you very much.

========================

Timestamp: 14:35:14
Identifier: (local system)/LM/W3SVC/3/ROOT-1-129948401117011289
Codebase: D:\OTS\Production\TemplateService\
Source: Aspose.Words
Title: Index was outside the bounds of the array.
Detail:
System.IndexOutOfRangeException: Index was outside the bounds of the array.
at x6c95d9cf46ff5f25.xcd4bd3abd72ff2da.x792b6f092cbf4bb1(Int32[] x9d5750eb2d6373bc, Int32 xc0c4c459c6ccbd00, Int32 x961016a387451f05, Int32 xbcea506a33cf9111)
at x6c95d9cf46ff5f25.x09ce2c02826e31a6.set_xe6d4b1b411ed94b5(Int32 xba08ce632055a1d9, Object xbcea506a33cf9111)
at xa604c4d210ae0581.xa55b88ee4e81381b.WriteCore()
at xa604c4d210ae0581.x485adbf5506556e8.x6210059f049f0d48(x7f77ea92be0d9042 x94aec03cf2ae750b)
at x9e260ffa1ac41ffa.x163859bfa28558c4.xfc53bd8a6982db4c()
at x9e260ffa1ac41ffa.x163859bfa28558c4.VisitRowEnd(Row row)
at Aspose.Words.CompositeNode.xf7ae36cd24e0b11c(DocumentVisitor x672ff13faf031f3d)
at Aspose.Words.CompositeNode.x464d2134480a7bf2(DocumentVisitor x672ff13faf031f3d)
at Aspose.Words.CompositeNode.xf7ae36cd24e0b11c(DocumentVisitor x672ff13faf031f3d)
at Aspose.Words.CompositeNode.x464d2134480a7bf2(DocumentVisitor x672ff13faf031f3d)
at Aspose.Words.CompositeNode.xf7ae36cd24e0b11c(DocumentVisitor x672ff13faf031f3d)
at x9e260ffa1ac41ffa.x163859bfa28558c4.x51ee56decc29a9da(Section xb32f8dd719a105db)
at x9e260ffa1ac41ffa.x163859bfa28558c4.x160a0bf4de8f6bd0()
at x9e260ffa1ac41ffa.x163859bfa28558c4.x8cac5adfe79bc025(x8556eed81191af11 x5ac1382edb7bf2c2)
at Aspose.Words.Document.xf381a641001e6830(Stream xcf18e5243f8d5fd3, String xafe2f3653ee64ebc, SaveOptions xc27f01f21f67608c)
at
Aspose.Words.Document.Save(String fileName, SaveOptions saveOptions)
at SGS.OTS.TemplateLibrary.AsposeHelper.SaveWordDocument(String wordFilePath, Document doc, Boolean replaceCellBookmarkToSmartTag)
at SGS.OTS.TemplateLibrary.Operators.InstanceGenerator.GenerateInstance(ReportDatasource datasource, UIViewType subBu)
at SGS.OTS.TemplateLibrary.Operators.ServiceOperator.GenerateTestReport(TemplateInstanceInfo reportInfo, ReportDatasource datasource)

Hi,


Thanks for your inquiry.
wengyang:
Did any other user find the same issue when they use Aspose.word version 9.4, has this issue been fixed in new version? it seems it is a defect that the Index was outside the bounds of the array when it was dealing with multi-threads calls.
It would be great if you please share your document for investigation purposes.
wengyang:
If this issue is never reported by other users before, May I get a trial version? for eg. 30 days trial version, so that we can do a compare and persuade the company to buy the new license and upgrade it to the latest version.
You can request a 30-Days Temporary License. Please see the following link for more information.
http://www.aspose.com/corporate/purchase/faqs/temporary-license.aspx

Please download latest version of Aspose.Words for .NET.