Free Support Forum - aspose.com

NullReferenceException when setting the license

I recently purchased Aspose.Pdf for .Net component.

From time to time, I'm getting NullReferenceException in the following line:

license.SetLicense("Aspose.Pdf.lic");

Please advise.

Thanks,

Ofer.

Hi Ofer,

Thanks for your inquiry. Are you using using multithreaded approach? As we have noticed such issues when a document is being accessed in more than one threads. Aspose APIs do support multithreading and you may create multi-threaded applications using these APIs. But, these are 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.

If you are not using multithreaded approach then please share some more details about your scenario to replicate the issue at our end.

We are sorry for the inconvenience caused.

Thank you.

Hi,

I'm not using multithreaded approach.

This is the full exception:

System.NullReferenceException: Object reference not set to an instance of an object.
at š..?(Stream )
at š..?(String , Assembly )
at Aspose.Pdf.License.SetLicense(String licenseName)System.NullReferenceException: Object reference not set to an instance of an object.
at š..?(Stream )
at š..?(String , Assembly )
at Aspose.Pdf.License.SetLicense(String licenseName)

What information do you need?

Hi Ofer,


Thanks for your feedback. I am afraid we can not suggest you anything without replicating the issue at our end. Please share some sample project and your license file to replicate the issue at our end. Moreover, kindly share license file via email as suggested here.

Best Regards,