Free Support Forum - aspose.com

SetLicense Method throws an error

Hi ,
I am using Aspose.cells componet. I have written the same code SetLicense method to apply the license before using the Aspose component. I have placed the aspose.total.lic in someother path and passing that path to the SetLicense Method. some times it is working ,but in some cases it is throwing file not found error. I have used HostingEnvironment.MapPath method to get the License path…can you help me on this.

@samaravim,

What is the error message you got? Your issue can be related to configuration in your environment. By the way, do you use Partial trust or medium trust level/mode on your machine. If this is the case, please run your project in full trust level permissions set, see the document for your reference:
https://docs.aspose.com/display/cellsnet/Declaration

If you still could not evaluate, could you create a simple console (runnable) demo application (“hello world” type), zip the project without Aspose.Cells.Dll (and excluding .lic file), so we could execute your project to reproduce the issue on our end, we will check it soon.

yes I have created the simple console application. But I wonder I am able to utilize the Aspose.cells component without License. We have configured the license file In a separate xml file. we are checking the file exist or not then we are passing that string to SetLicense Method. But we are getting error message like file not found …it s not everytimes …sometimes only facing the file not found error. Also is the setLicense method is mandatory for Aspose.cells component?

@samaravim,

You may use Aspose.Cells component without license but you will be working in evaluation mode. In evaluation mode, there are certain limitations, so you should know about it, see the document for your reference:
https://docs.aspose.com/display/cellsnet/Licensing#Licensing-EvaluationVersionLimitations

As you mentioned the error (i.e., file not found) which is related to System.IO error and may not be related to Aspose.Cells component. You should debug your own code (line by line) to fix the issue (regarding file not found exception) by yourself. Anyways, we need to reproduce the issue on our end, so as requested earlier, provide us a simple application, we will check it soon.