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

Free Support Forum - aspose.com

AsposePDF.Net throwing 'NullReferenceException: Object reference not set to an instance of an object' while setting license

I am getting inconsistently the following error message while setting license file,

Error message:
Error Message:System.NullReferenceException: Object reference not set to an instance of an object.
   at  ? .(Stream )
   at  ? .(String , Assembly )
   at Aspose.Pdf.License.SetLicense(String licenseName)
   at Com.Stpl.Av.AsposePDF.AvAsposepdfreader..ctor()

I am using AsposePDF.Net v16.12 and the license file (Aspose.PDF.lic) is embedded in DLL file since we don’t want to expose the license file. The issue is inconsistent and I could not provide you exact scenario for this. The following is the code sample used to set the license

Code Sample:
Aspose.Pdf.License license = new Aspose.Pdf.License();
license.Embedded = true;

This is happening very frequently. Can you please help me in resolving this issue.

Chenna Basappa


Thank you for contacting support.

Would you please upgrade to Aspose.PDF for .NET 18.9.1 in your environment and share it the exception still occurs frequently. Please also mention some details about your application including type, platform, single threaded or multi-threaded etc so that we may investigate further to help you out.

You mean, Do you have issue with the version v16.12.0 and it is fixed in v18.9.1?
I am using the version v16.12.0 in production, it may take sometime to replace the DLL in production. It has to pass through our Validation process before we deploy it into Production.
I am using this DLL in IIS Application server (Server 2016). The application is multi-threaded application. The issue is inconsistent. When the issue comes we need to restart the IIS server. After restarting IIS sever application starts working without complaining License issue.

Chenna Basappa


Please note that the support is provided based on latest available versions so please upgrade and share your kind feedback with us. Similar issue for multi-threaded environments was rectified recently, so the latest version will hopefully resolve the problem you are currently facing.

Thank You Farhan.
I think now the latest version available is v18.10.0, let me verify using this version and I will let you know the status.


You are right about latest available version. Please take all the time you need and then share your feedback with us as per your convenience.