I just purchased aspose.total and am using aspose.cells within a project. I'm having a problem getting the license to work.
- I copied the license into the bin directory with aspose.cells.dll
- I attempt to use the code below, but in the 2nd line, "license" in "license.SetLicense" is not delared
Dim license As Aspose.Cells.License = New Aspose.Cells.License
license.SetLicense("Aspose.Total.lic")
- Can you offer a suggestion? I'm declaring it in the line immediately before.
Thanks,
da
Hi,
It's very strange. Could you create a simple application using your license file, zip it and post it to us, we will check your issue asap. And, please follow the steps mentioned in the doc to post the the zipped project with license file via only email: https://forum.aspose.com/t/how-to-send-license-file-to-support-team/225542
Thank you.
Yes, I'll do that, but may be able to avoid it by asking you a question. My project is built with Iron Speed and I declare the license inside a class. I saw a note on the forum where someone said the problem would be fixed if the code was implemented in the OnStart event.
Do you think this may be a factor? Any recommendations re this code?
Hi,
Thank you for considering Aspose.
If your project is a web application, then you may try by placing your licensing code in the Application_Start or Session_Start event(s) in global.asax file and see if it works fine.
Thank You & Best Regards,
Hi,
I'm continuing to have the same problem.
Yes, my app is a web application. I placed the following code in global.asax as you suggest, but no luck. In visual studio 2008, the license.setlicense is underlined indicating license is not declared. I tried using "myLicense" which had no effect. Please help, I've purchased a total license and can't get the license to stick.
Dim license As Aspose.Cells.License = New Aspose.Cells.License
license.SetLicense("Aspose.Total.lic")
I think you can create a simple web application to test this license issue. The problem may be caused by other code instead of our license code.
For what it's worth, the problem was not in other code, it was an error to set the license properly.
In global.asax, this works:
Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
' ' Code that runs when a new session is started
Dim license As Aspose.Cells.License = New Aspose.Cells.License
license.SetLicense("Aspose.Total.lic")
End Sub
Hi,
Good to know that your issue is resolved. I think the best way to set the licensing code for a web application is using Global.asax events (e.g Session_Start, Application_Start), this way you don’t need to set the licensing code multiple times as it will be required only one time and processed once for the whole life time of your application.
Have a good day!