Free Support Forum - aspose.com

SetLicense Problem

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


Hi,

It looks very strange as you got the issue. I still think this type of issue has no concern/links with Aspose.Cells product. The error refers to that you don't have enough security permissions to process your IO task. We also recommend you to use our latest versions e.g v7.0.2.

Also, if you still find the issue, I am afraid we need the issue to be reproduced on our end as we have not find any such issues. Please create a separate application with your license file, zip it and post us via email, see the link on how you will post us the project with license file, we will check it soon.
http://www.aspose.com/corporate/purchase/faqs/send-license-to-aspose-staff.aspx

Hi,


We received your sample project with your license files.

I have tested your issue using your code segments in Default.aspx.vb with your license files provided, it works absolutely fine. I got no issues what so ever clicking on the “Start Aspose.Cells” button. I have attached my complete Web project here for your reference. For security reasons, I excluded the Aspose.Cells.lic and Aspose.Words.lic files in the project. Could you open the project, add both the license files to it (in VS.NET 2008, Right-click on the solution and click “Add”, now click Existing item…to add both license files), compile and run this project on your environment, it should work fine as it is working here.

Thank you.

Hi,

Your Web project is correct, I didn't receive any error ! but I send you my sample project with Aspose.Cells.dll version 5.3.2.0 and you send me a project with Aspose.Cells.dll version 4.9.0.0. If a create a new Web project with 5.3.2.0 release I get error, otherwise all seems ok !

Recemtly I upgraded Aspose.Cells.dll from 4.9.0.0 to 5.3.2.0

Am I doing something wrong ?

Regards

Stefano

From my Web application in VS2008 environment, I just added again Aspose.Cells.dll (version 5.3.2.0) using "Add" , "Existing item .." , and now all seems ok ! I get no more error !

Maybe I added it before just doing a copy-paste from Windows Explorer (not using VS2008 ide)! Is there any difference ? maybe have caused the error ?

Regars

Stefano

Hi,

I think, there is no difference in copying the dll or using the VS-2008 tool, probably, you were copy-pasting wrong dll. It is possible, the target framework of your earlier dll is different than what you have installed. And now you have got the dll, which has the same target framework as installed on your machine.

Hi,


Good to know that your problem is solved. By the way, I double - checked my attached project and confirmed that the version of Aspose.Cells.dll file is v5.3.2. Also, the best way to replace the component’s older dll with new dll file is to remove the older reference of the product first in VS.NET, now add reference to new/desired dll file in VS.NET, compile and run the project, it should work fine.

Thank you.

Hi,

You're right, dll versione was 5.3.2. I will follw your instructions to repalce the component!

Many thanks for your support

Regards

Stefano