Hi,
I have some coding using Aspose.PDF. Most of the time it works fine. But every couple of days it dies with the message "System.NullReferenceException: Object reference not set to an instance of an object. " referencing the line where we have lic.SetLicense:
License lic = new License();
lic.SetLicense(“Aspose.Pdf.lic”);
It’s easily resolved by copying the .lic file to the directory again to overwrite the existing copy. But it’s a pain to have to keep doing this.
The copy of the .lic file we’re overwriting doesn’t seem damaged in any way and the filesize is as it should be.
We’re using v4.1.2.0 (can’t use a newer version as you changed something to do with measurements)
The aspose.pdf.lic files is int he /bin directory with the DLL
Any ideas as to what causes this?
Or is there a way we can put the contents of the .lic file as a string in our source code and load it from there?
Hi Duane,
Thanks for using our products. However, the version you are using too old, we would appreciate if you try the latest version of Aspose.Pdf for .NET v6.8.
Please check the following documentation links for setting Embedded License in your .NET application.
Using as Embedded resource
If you still face the issue, I would suggest you to test your license by loading license from file path as mentioned in below link.
Using File or Stream object
Please feel free to contact support in case you need any further assistance.
Thanks & Regards,