We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Setting license file

My .lic file is located in the bin\ directory along with the DLL and I have a page which is called many times during the day by many people in the company. That page has the following code:


Dim license As Aspose.Pdf.Kit.License = New Aspose.Pdf.Kit.License
license.SetLicense(“aspose.pdf.kit.lic”)

Is it okay that this is called many, many times during the day on the same page over and over? Or should it only be called once (somehow?) and then never called again?

When does the license get reset? During an application reset?

Thanks,
-Dave

Hi David,

The license only needs to be set once per application domain. Calling SetLicense multiple times is not harmful, but simple wastes processor time. In a web application, you can call the license setting code in Application_Start method of Global.asax file.

I hope this helps. If you have any other questions, please do let us know.
Regards,

I'm sorry but this does not seem to work properly for me. The following code is in the Application_Start function of Global.asax.vb:

Dim license As Aspose.Pdf.Kit.License = New Aspose.Pdf.Kit.License

license.SetLicense("aspose.pdf.kit.lic")

It does not register the software. I still get the red header notice on the top of all PDFs which says it is an evaluation copy.

If I place that same code into the ASPX page which every hits, just prior to performing the same PDF form fill-in generation, the message goes away.

-Dave

Hi David,

Please try to place this code in Session_Start method and test with that. I hope it will work. However, if you still find any problem then please share the sample project with us, so we could look into the issue at our end.

We’re sorry for the inconvenience.
Regards,

This did not work either.


The project is simple. Just do anything in any web form. If you don’t call SetLicense, then you get the evaluation writing on top. Even if SetLicense is called in Global.

-Dave

Hi David,

Please find attached a sample web application. Please place your license file in the bin folder and then run the project. It worked fine at my end. I placed the license code in Session_Start method.

Please try the project at your end and see if it helps you in someway. If problem persists then please do let us know.
Regards,