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

Free Support Forum - aspose.com

Setting license for Aspose.PDF from Embedded Resource


I’m unable to use SetLicense() for Aspose.Pdf in the same way as for other packs. The following code works for the first 3 license sets (the file “Aspose.Total.lic” is an embedded resource), but the 4th set for Pdf fails with a FileNotFoundException “Cannot find license ‘Aspose.Total.lic’”:

Aspose.Slides.License license = new Aspose.Slides.License();
Aspose.Words.License wordsLicense = new Aspose.Words.License();
Aspose.BarCode.License barcodeLicense = new Aspose.BarCode.License();
Aspose.Pdf.License pdfLicense = new Aspose.Pdf.License();

We specifically don’t want to deploy the file as a content file for obvious security reasons. Please help urgently as we need to get this deployed ASAP.

Many thanks

Hi Ross,

Well, it seems very strange. Please send your license file
to us and we will check the issue and get back to you. Please follow the steps
mentioned in the below link to send us the license file:


Sorry for the inconvenience,

Hello Ross,

Thanks for using our products.

Well, before you send out the license file to us, I would suggest you to please try accessing the embedded license file through following code lines. In case the problem still persists, please share the license file by following the steps specified by Nausherwan. We are sorry for your inconvenience.


// create license object
Aspose.Pdf.License pdflic = new Aspose.Pdf.License();
// specify the embedded file information. MergedAPI is default namespace of project
// embed the license file within solution
pdflic.Embedded = true;


It seems that adding the namespace has resolved the issue. Just something to note that this means that the licensing for Aspose. PDF works a little differently to the others.

Many thanks!

Hello Ross,

When using license file as an embedded resource with Aspose.Pdf for .NET, you need to provide the name of Default project namespace. The scenario/usage is different from other products. In case of any further query, please feel free to contact. We are sorry for your inconvenience.