Free Support Forum - aspose.com

Random Licence problem

We experiment radom licence problem.

SetLicense methos throw :

System.Web.HttpUnhandledException: Exception of type System.Web.HttpUnhandledException was thrown. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at Aspose.Cells.¿.¿(Stream ¿)
at Aspose.Cells.¿.¿(String ¿, Assembly ¿)
at Aspose.Cells.License.SetLicense(String licenseName)
at BNC.SIRHO.SuiviAppel.Web.Base.PageBase.Page_Load(Object sender, EventArgs e)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain()
--- End of inner exception stack trace ---
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain()
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

We have two applications ASP.Net. One the license is in the BIN folder and the other is embedded in the dll.

When this occurs, we simply remove a DLL from the bin and recopy it to the BIN. Asp.Net recompile the application and all is ok after that.

The problem becomes urgent for us because we cannot guarantee stability to our customers.

We use Aspose.Cells 1.0.3705 .

How do you set the license? Could you post your sample code here?

Aspose.Cells doesn't have a version of 1.0.3705. It starts from v3.7.

And you just need to call SetLicense mehtod once at the start of your program. It's better to put it in Application_Start event.

The code:

asposeLicence.SetLicense("Aspose.Excel.lic.xml") on the Page_Load of all page.

The license name : Aspose.Excel.lic.xml for both version (Embedded, Bin)

Sorry, the runtime version is 1.0.3705. The Aspose.Cells version is : 3.7.0.0

Do you think this problem is cause because I set the license more than one time?

Yes. I think this problem may be caused by repeatedly calling SetLicense method in Page_Load event.