Error setting licence only in release

We have recently bought Aspose.Cells, using version 18.9. We set the licence at startup of our MVC application (global.asa), with this code:

new License().SetLicense("Aspose.Cells.lic");

Everything works fine in debug, but in release mode, licence is not found: “Cannot find license ‘Aspose.Cells.lic’”. File is correctly embedded in assembly.

However, this code works in both debug and release mode:

Monitor.Enter(typeof(MyClass));
new License().SetLicense("Aspose.Cells.lic");
Monitor.Exit(typeof(MyClass));

So we think it could be a bug.
We are temporary using the SetLicence overload that takes a stream parameter, which works fine, by previously extracting the file from assembly.

Regards

@DeliaZgz,

Thanks for your query.

Could you please send us a simple MVC application which can be used to reproduce this issue? This application shall have only the code to load the license and no other functionality should be there for the simplicity. Also there is no need to send the license along with the code as I will use my own license for this testing. If possible please send us two applications, one which is not working and the other one which is working with the following code.

AsposeCellsTest.zip (1015.4 KB)

I attach a solution as small as a can in order to reproduce the problem. Steps:

  • Copy aspose.cells dll to bin folder
  • Fill aspose.cells.lic file contents
  • Compile in release and publish website on IIS (not IISExpress). Tested in 2 different Windows Server 2012 R2

In “Excel” class you’ve got several fragments of code which work and don’t work.

Another way to make it work is compile without code optimizations, as other people in your forums have discovered, please see Unable to load embedded license when compiled in release mode.

In Visual Studio it always works, even in release mode, so it could be an issue with IIS. Our app pool is in integrated mode, CLR v4.0

Thank you

@DeliaZgz,

We are working on this query and will provide our feedback soon.

@DeliaZgz,

We have tried to re-produce this issue but could not observe it yet however we need to look into it more. We have logged the issue in our database for investigation and for a fix. Once, we will have some news for you, we will update you in this topic.

This issue has been logged as

CELLSNET-46412 - License is not working in release version of MVC application when deployed on IIS server

@DeliaZgz,

Please use License.SetLicense(Stream stream) method to set the license.

Let us know your feedback.

That’s what I’m doing, as I told you in my first comment. You can see it in my code sample, this is one of the fragments that works.

I thought you would like to fix the bug with License.SetLicense(string) method. I can tell you that it’s not happening with Aspose.Words.

@DeliaZgz,

We have recorded your comments with the logged ticket and will provide our feedback here when ready to share.

The issues you have found earlier (filed as CELLSNET-46412) have been fixed in this update. This message was posted using Bugs notification tool by simon.zhao