We are facing object reference error randomly when executing the Aspose.Pdf.License.SetLicense code. We are using Aspose.Pdf file version is 8.8.0.0.
Below is the code snippet we have used in our static class.
Aspose.Pdf.License pdfLicense = new Aspose.Pdf.License();
pdfLicense.SetLicense("Aspose.Total.lic"); //Exact line.
The Aspose.Pdf.License SetLicense is initialized
under individual static method and it is invoked by the static constructor of the same class.
Once the object reference error is thrown, its gets sorted out only after resetting the IIS (Even after initializing the object again, the error is keep repeating until we reset IIS).
We are already calling this license code in static constructor only. So what can be done to avoid these type of exceptions as we cannot reset IIS everytime when we get this error in production.
Request your expertise advice to sort out this issue.