SetLicense from user control

In my web app, I have a page that sets license like this:

Aspose.Pdf.License licAspose = new Aspose.Pdf.License();
licAspose.SetLicense(“Aspose.Total.Product.Family.lic”);

I have the license file in the application’s bin folder. This used to work for years with no problem.

Recently I moved the license setting code into a user control. This resulted in a strange thing. Each time I re-deploy the application, I start getting the red Evaluation Only line. After creating a number of PDFs, the line disappears.

How can it be explained?

Hi Eliyahu,


The license file is validated when first object of Aspose.Pdf is initialized. We recommend the approach to initialize the license at the start of application or loading of first web page. Please note that once the license is initialized, it does not require re-validation during the application execution cycle. As per my understanding, until the specific user control behind which the license initialization is present, is not invoked/triggered, the license is not initialized.

In case the problem still persists, can you please create some sample application which can help us in replicating this problem. We are sorry for this inconvenience.

PS, Please ensure that license file is removed from solution when attaching in this forum thread and visit the following link for instructions on How to send a license?