Help � need to get this working by today. (sorry for the short notice)

Help – need to get this working by today. (sorry for the short notice).


Exception thrown when I call the “Aspose licence file file could not be read:
Illegal characters in path.
” When I call the “license.SetLicense(reader.ReadToEnd());“.<?xml:namespace prefix = o ns = “urn:schemas-microsoft-com:office:office” /><o:p></o:p>

Is there a mistake in the code I have or the licence file? Also, The file name and location is correct because if I force the file name to be wrong “zzzAspose.Total.lic” it generates a different message of file not found. So it’s finding the file. The licence file was purchased and created by a contracting developer who’s left.

StreamReader reader = System.IO.File.OpenText("Aspose.Total.lic");

//

// AisiSharepointClient.Reports.Aspose.Total.lic

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

license.SetLicense(reader.ReadToEnd());

File name = “Aspose.Total.lic”

<?xml version="1.0" encoding="utf-8"?>

<License>

<Data>

<LicensedTo>############</LicensedTo>

<LicenseType>Site Small Business</LicenseType>

<LicenseNote>Limited to 10 physical sites, not to exceed 10 developers</LicenseNote>

<OrderID>############</OrderID>

<OEM>This is not a non-redistributable license</OEM>

<Products>

<Product>Aspose.Total</Product>

</Products>

<EditionType>Enterprise</EditionType>

<SerialNumber>########-####-####-####-############</SerialNumber>

<SubscriptionExpiry>20140630</SubscriptionExpiry>

<LicenseVersion>2.2</LicenseVersion>

</Data>

<Signature>############################################################################################################################################################################</Signature>

</License>

Hi Shawn,

Thank you for the details.

Well, there is an issue in your code. SetLicense method supports either a complete file path or a file stream as a parameter. You may check the details using the below links.

SetLicense Method
SetLicense Overload_1

However, you are passing it a string of file contents which will not work. Either you need to pass the file path or a file stream. Please check the following documentation links regarding setting the license. In case you still face any issue, please do let us know.

Using File or Stream object

Using as Embedded resource

Thank You & Best Regards,

Yup, that fixed it. thanks.

Aspose.Pdf.License license = new License(); license.SetLicense("Aspose.Total.lic");license.SetLicense("Aspose.Total.lic");

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

Hi Shawn,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for the confirmation.

We are pleased to know that your issue got resolved. Please keep using our product and in case you need any assistance, please feel free to contact support.

Sorry for the inconvenience,