Setting the License File from embedded resource - Error

Our product was previously compiled to use a license file that was in the same file directory as our application that uses Aspose.pdf.dll. We recently changed our program to use the "Short Name of an embedded license file" using the License.SetLicense("Aspose.Pdf.lic") method and embedded the license file into our application.

After updating to a new version to Aspose.pdf and embedding the updated license file into the application, some of our customers (ones that still had the license file in the same directory) had errors when using our application, because the SetLicense method defaulted to use the license file that was in the directory before the embedded resource license.

I think that either this method should either look at the embedded resource first, or there should be an override that specifies the use of the embedded resource file.

Thanks,

Steve

Hello Steve,

Thanks for using our products.

When license file is embedded into solution, then you can simply call License.SetLicense(..) method by passing license file name as argument. So Aspose.Pdf for .NET will try to use that license file. Please take a look over the following scenario.

If the license file included in project has a name Aspose.Total.lic, then you can simply call the method as

license.SetLicense("Aspose.Total.lic");

In case you still face any problem, please share the license file so that we can test the scenario at our end. Please visit the following link for information on How to send a license?

As per my initial test with one of my license file, I am unable to notice the problem.

We apologize for your inconvenience.

Yes, this is the method that we used, but it used the license file in the application's running directory and not the embedded license file.

license.SetLicense("Aspose.Pdf.lic");

This caused errors when the for customers when setting the license after we upgraded to a new version of aspose.pdf.dll.

We were able to correct the issue by deleting the license file in the application's running directory. The program then used the embedded license and all was well.

Hello Steve,

Thanks for sharing the information.

I have tested the scenario and I’m able to reproduce the same problem. For the sake of correction, I have logged it in our issue tracking system as PDFNET-20174. We will investigate this issue in details and will keep you updated on the status of a correction.

We apologize for your inconvenience.

Was this issue ever resolved? Im having the same problem with Aspose.PDF v. 8.9.1.0

Hi Jonas,

Thanks for contacting support.

In order to use license as an embedded resource, please try using the following code lines. Furthermore, we recommend you to please try using the latest release of Aspose.Pdf for .NET 9.0.0 and in case you encounter any issue, please feel free to contact.

[C#]

Aspose.Pdf.License
license = new Aspose.Pdf.License();

// FormMergedAPI is the default namespace of project

license.SetLicense("FormMergedAPI.Aspose.Total.lic");

license.Embedded = true;