We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Cannot find license on ASP.NET

I just moved from Visual Web Developer 2005 to Visual Studio 2008 Pro. I also added the .NET Framework 3.5 and the Ajax Control Toolkit .dll. I copied all my files for a project with VWD 2005 to the new VS 2008 directory, including the Aspose.cells.lic and Aspose.cells.dll files into the bin subdirectory. Using the same code as before,

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

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

I now get a "Cannot find license" message. Any ideas?

Hi,

Kindly make sure the valid Aspose.Cells.lic file is there in /bin folder. By the way could you give us the complete error descirptions, do you use the license file as an embedded resource? We appreciate if you could you create a simple project to use the license file, zip it and post us to show the issue, we will check it soon. To post the project contaning the license file, kindly click the Contact button (attached to this message frame), in the drop down list options click "Send Amjad Sahi an Email and attach the project and send it.

Thank you.

The complete message is System.IO.FileNotFoundException, {"Cannot find license 'Aspose.Cells.lic'.":null}

I am not using an embedded resource.

Hi,

Could you create a small separate project using your license file with Aspose.Cells for .NET and check if it works fine. If not, kindly post the project to us, we will check your issue soon. To post the project contaning the license file, kindly click the Contact button (attached to this message frame), in the drop down list options click "Send Amjad Sahi an Email and attach the project and send it.

Thank you.

I emailed a new project as you requested. But the new project works as it should.

Hi,

It looks strange. Since your test project works fine to use the license file so your original project should also work fine. The file not found exception normally occurs when it does not find the file in the specific path. Could you debug your application why the error is occured and where it actually searches the file related to your file path. Also, kindly do check the file name with extension if you are giving the same name with extension in your code.

Could you also try to explicitly set the license file path. Create some folder to your project folder e.g.., "files" and add the license file to it.

e.g..,

string path = Server.MapPath("~");

string licFile = path + \\files\\Aspose.Cells.lic";

Aspose.Cells.License license = new Aspose.Cells.License();
license.SetLicense(licFile);

..............

Thank you.

The Aspose.Cells.lic file is in \bin, and I call Aspose.Cells from a .cs module in App_Code, so here is what works for me:

string path = HttpContext.Current.Server.MapPath("~");

string licFile = path + "bin\\Aspose.Cells.lic";

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

license.SetLicense(licFile);

I didn't mention that the problem only occurred when in debug on my dev laptop, not on the web server. This must have something to do with VS2008 on my laptop. VS2008 already does one other odd thing. I have to explicitly tell the debug web server to use port 8010, or it thinks another web server is already using port 8000. Anyway, thanks for your help.