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

Free Support Forum - aspose.com

Index was outside the bounds of the array error when setting license


I’m using the latest version of Aspose.Slides ( When trying to set the license file from an Aspose Total license, I’m getting the following error:

System.IndexOutOfRangeException: Index was outside the bounds of the array.
at .a.(Int32 param0)
at ..(String licenseName, Assembly clientAssembly)

This is my code:

string folderPath = (Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? string.Empty);
string licensePath = Path.Combine(folderPath, “Aspose.Total.lic”);
Aspose.Slides.License license = new Aspose.Slides.License();

The same license file works fine for Aspose.Words and Aspose.Cells, and the license for all three components are being set in exactly the same way.

The server is running Windows Server 2008 R2 x64, and the code is being used in a Windows service. I’ve tried this locally on my development machine running Win7x64 and the license is set without any errors.

Any ideas what could be causing this problem?



Hi Mun,

I have tried to understand the issue shared by you. Can you please share a working sample and scenario where by you are setting the license as service, so that we may reproduce the issue on our end and help you out further.

Thanks and Regards,

Hi Mudassir,

I’ve done some more investigation into this, and the problem actually occurs only when the Aspose.Slides DLL is merged with our assembly using the ILMerge tool (http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=17630). When the Aspose.Slides DLL is referenced directly, the license can be set with no problems.

Thanks anyway for getting back to me.


Hi Mun,

Thanks for sharing the information. I am not sure whether Aspose.Slides for .NET can be used in conjunction with your assembly using ILMerge tool. An issue with ID 29763 has been created in our issue tracking system to further investigate and resolve the issue. We will share further information with you once information is shared by our development team for this issue.

Thanks and Regards,