Hi, some months ago I had the following error when I try to SetLicence of Aspose.Cell dlll:
Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.
Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
Source Error:
Line 6: ' Code that runs on application startup
Line 7: Dim licenseXls As Aspose.Cells.License = New Aspose.Cells.License
Line 8: licenseXls.SetLicense("Aspose.Cells.lic")
Line 9:
Line 10: End Sub
An Aspose staff member (Amjad Sahi) suggested me this solution:
... I think you may try to put the license file on some folder in your web project/application and then may use Server.MapPath to access the file in the folder,
Dim path As String = HttpContext.Current.Server.MapPath("~")
Dim licFile As String = path & "\Aspose.Cells.lic"
Dim license As Aspose.Cells.License = New Aspose.Cells.License()
license.SetLicense(licFile)
This solutions was OK till today, when I get the same previuos error. The strange thing is that I use the same code for Apsose.Words without error, but when I try to use Apsose.Cell I get the error (Aspose.Cells.lic and Aspose.Words.lic files are in the same direcotory):
Description:
The application attempted to perform an operation not allowed by the security policy.
To grant this application the required permission please contact your system administrator
or change the application's trust level in the configuration file.
Exception Details: System.Security.SecurityException: Request for the permission of type
'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089' failed.
Can someone help me ?
Regards
Stefano