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

Free Support Forum - aspose.com

Aspose.PDF DLL Throwing Exception and Stops Working- HELP- URGENT!


I am using Aspose.PDF (version and purchase the Aspose.Total .Net License Less than a year ago, for 3 main operations:
1. reading pdf file by converting the pdf page to an image.
2. merging pdf files into one file.
3. text extraction.

Today we have faced a horrible problem in one of our live installations; for some reason Aspose.PDF started raising exceptions such as:

[EXCEPTION ] --> Object reference not set to an instance of an object.
[STACK TRACE] --> at .Š.€(Stream )
at .Š.€(String , Assembly )

the problem with Aspose.PDF is when this error starts showing up all actions performed using Aspose.PDF throws the same exception. It looks like something static inside the Aspose.PDF gets broken and the problem gets persistent. No actions can be performed until the whole process is killed and restarted. Please note that this is a web application with hundreds of users and killing the process means the system gets down for all of them.

Such a problem is causing our system being unfunctional for a couple of hours, and users get effected. The client is really really upset about this problem, and we have to find a solution right away.

Below are some facts about the problem, which we hope can help you figure out what is wrong.

1. This issue does not happen all the time; in fact it happenned for the first time in last 2 weeks.
2. When the exception starts showing up, Aspose.PDF dll is totally unusable (throws same exception for every action such as merge files, extract text etc.), until the process (w3wp) is restarted.
3. The issue is 90% related to something static inside Aspose.PDF
4. We have no idea about how to reproduce this (and hope it will not happen again, otherwise the client will kill me)
5. We have no idea about what triggerred this problem
6. Killing the w3wp process fixed the problem; however this is a terrible solution for any enterprise systems.
7. We absolutely do not cache any object related to Aspose.PDF; for each action it is created, license set and used.

Today, my system has been non-functional for about 7 hours due to this issue. As a company, i am really in a though situation now since client asks for an explanation as well as a solid situation.

I either need to figure out what causes this so that we can avoid it. Maybe you can provide possible reasons. I also need a solution; even a way to "refresh" the Aspose.PDF static stuff so that system functions properly without totally taking it down.

I have the same problem as the related post and I got to the same conclusions as they have, How did you solved their problem ??

please do not say "be patient". This has been the worst problem I have faced so far.

Thanks in advance.
Hi Roei,

We are sorry for the inconvenience. I am afraid it is quite difficult to suggest you anything without replicating the issue at our end. However please consider couple of things and share the results. Aspose.Pdf supports multi-threading but it is multi-thread safe as long as only one thread works on a document at a time. If you manipulate a single document in different threads, the results would be unstable.

Furthermore please check your license implementation logic. It is suggested to set license in some Application Level event. When you will set the license in application level event/scope, it will remain valid till the lifespan of application.

  • If you are developing an ASP.NET application, you can call License.SetLicense from the Global.asax.cs (Global.asax.vb) file, in the Application_Start protected method. It is called once when the application starts. Do not call License.SetLicense from within Page_Load methods since it means the license will be loaded every time a web page is loaded.
  • If you are developing a Windows Forms or console application, call License.SetLicense in your startup code, before using Aspose.Pdf for .NET classes.
  • If you are developing a class library, you can call License.SetLicense from a static constructor of your class that uses Aspose.Pdf for .NET. The static constructor will execute before an instance of your class is created making sure Aspose.PDF for .NET license is properly set.

Best Regards,