Aspose.Pdf can't find its license file

1.4k views Asked by At

I have this code in a PDF generation method:

Dim license As license = New license
License.SetLicense(Path.Combine(Request.PhysicalApplicationPath, "bin", "Aspose.Pdf.lic"))

I also tried simply:

Dim license As license = New license
License.SetLicense("Aspose.Pdf.lic")

I verified that the license file exists at the above path, but I still get this error:

Cannot find license 'C:\Users\MyUsername\source\repos\MyApp\Src\MyProject\bin\Aspose.Pdf.lic'.

If the license file is there (and it does appear to be a legitimate XML file, not just a placeholder), why is it not being found?

1

There are 1 answers

0
ekolis On

I needed to give the IIS_IUSRS user group on my PC "full control" permission to the license file. I'm not sure why Aspose.Pdf needs to be able to write the license file, not just read it, but that seems to have worked.