Aspose.pdf.License.SetLincese error - Object reference not set to an instance of an object

Good Morning,

I would like to get some help from the forum if it is possible.
We have a .net app using aspose license for print pdf files.
We are getting the follow error in UAT and PROD environments when passed 24 hours of working fine the app.
We trying to catch the error, but the only things that fix this error is to reset IIS on the server.
We re wrote the app to see if there were something in the old code, but it is still giving us the error.

We will really appreciate your help. We don’t know what else to do.

Thanks you in advance

Here is the error from the event log and see attaced doc file for a print screen of the error

Error: Exception of type ‘System.Web.HttpUnhandledException’ was thrown./nInnerException: System.NullReferenceException: Object reference not set to an instance of an object.
at a..€(Stream )
at a..€(String , Assembly )
at Aspose.Pdf.License.SetLicense(String licenseName)
at OZFormsGenerator.BLL.OZFormBase.SetAsposeTotalLicence(Boolean forced) in C:\TFS\Projects\Apps\OZFormsGenerator\OZFormsGenerator.BLL\OZFormBase.cs:line 78
at OZFormsGenerator.BLL.OZFormBase…ctor() in C:\TFS\Projects\Apps\OZFormsGenerator\OZFormsGenerator.BLL\OZFormBase.cs:line 41
at OZFormsGenerator.Default.PrintTheForm() in C:\TFS\Projects\Apps\OZFormsGenerator\OZFormsGenerator\Default.aspx.cs:line 53
at OZFormsGenerator.Default.Page_Load(Object sender, EventArgs e) in C:\TFS\Projects\Apps\OZFormsGenerator\OZFormsGenerator\Default.aspx.cs:line 28
at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)/n Stack: at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at ASP.default_aspx.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously).

Hi Allison,


Sorry for the inconvenience faced. I’m afraid its difficult to investigate the issue without replicating it. Could you please double check your license implementation? you only need to set the license once per application domain. To avoid this issue you should move the set license call to the start up method of your application which is only executed once. Please also make sure that you are using the latest version of Aspose.Pdf

Best Regards,