Hi,
I have a base handler which is being inherited by all other handlers which uses the Aspose for doing various tasks.
I have created a singleton class to set up the aspose license. I call the SetLicense method of this class on the OnBeginRequest() event of the base handler. But on the server where i have deployed the application i get error in
asposeTotalLicence.SetLicense(asposeFileName);
erro: Unable to locate Aspose Licence file:Aspose.Total.lic
Following ist he code for that singleton class
class AsposeLicense
{
private const string DEFAULT_ASPOSE_LIC_FILE = "Aspose.Total.lic";
private static bool __isLicenseSet = false;
protected AsposeLicense()
{
}
public static void SetLicense()
{
if (!__isLicenseSet)
{
string asposeFileName = string.Empty;
try
{
asposeFileName = DEFAULT_ASPOSE_LIC_FILE;
Aspose.Pdf.Kit.License asposeTotalLicence = new Aspose.Pdf.Kit.License();
if (string.IsNullOrEmpty(asposeFileName))
throw new Exception();
asposeTotalLicence.SetLicense(asposeFileName);
__isLicenseSet = true;
}
catch (Exception ex)
{
throw new Exception("Unable to locate Aspose Licence file:Aspose.Total.lic");
}
}
}
}
I have properly placed the .lic file in the bin folder of the application where it is deployed and i am not getting the evaluation version error.
Is there a possibility that because of the multiple async calls to the base handler i am getting this error. Once i get this error, it keeps getting the same error.
Could you help me in identifying the cause of this issue.
Thanks