License Update configuration

Hi, I just took over an application from the previous developer and I have been informed that the Aspose license will be expiring on the 32st of July 2025. I am struggling to find where the license is saved on Azure, is there someone who can assist?

@ttseabi

Cause

You are trying to locate the Aspose license file in your Azure environment, which is essential for ensuring your application runs without any licensing issues. The license file is typically stored in a location accessible to your application.

Solution

To find the license file, check the following common locations:

  1. Application Root Directory: The license file is often placed in the same directory as the application binaries. Look for a file named Aspose.Total.lic or Aspose.Cells.lic.

  2. Azure App Service: If your application is hosted on Azure App Service, access the Kudu console (Advanced Tools) to browse the file system. Navigate to the D:\home\site\wwwroot directory to check for the license file.

  3. Configuration Settings: If the license is stored in Azure Blob Storage or another external service, ensure that your application has the correct configuration settings to access it.

Code

Here’s a sample code snippet to set the license from a file:

// Instantiate the License class
Aspose.Cells.License license = new Aspose.Cells.License();
// Set the license file path
license.SetLicense("Aspose.Cells.lic");

If you are using a stream or an embedded resource, adjust the code accordingly.

Next Steps

  1. Check the mentioned directories for the license file.
  2. If you cannot find it, consult with your team or the previous developer to see if they have documented where the license is stored.
  3. Ensure that your application has the necessary permissions to access the license file if it’s stored in a secured location.

If you follow these steps and still encounter issues, please provide more details about your setup, and I will assist you further.

@ttseabi,

You may browse and try to find some sections, portions or places where the Aspose license can be stored in your Azure-hosted application.
1). Yo may look for “.lic” in code or configuration. Aspose licenses are typically applied via one of these patterns in code:
e.g.,

var license = new Aspose.Cells.License();
license.SetLicense("Aspose.Cells.lic");

or

license.SetLicense("path/to/license/file.lic");
license.SetLicense(new MemoryStream(File.ReadAllBytes("...")));

etc.
You may search for these in your solution with code text:
SetLicense, .lic (search entire solution directory), or Aspose.Cells.License

2). Check if the license file is being loaded from: a local file path (e.g. /App_Data/, /bin/, or embedded resources), an environment variable (common in cloud deployments), Azure Key Vault, blob storage, or app settings Or anything custom that points to a file or Base64 license string.

Azure Blob Storage
Some teams store license files in a blob container and load them like this:
e.g.,

var blobClient = new BlobClient(connectionString, containerName, "Aspose.Total.lic");
var stream = blobClient.OpenRead();
license.SetLicense(stream);

Example to check for Embedded Resource
Some developers embed the license file inside the project. In Visual Studio, open .csproj and search for .lic file(s). In code, check for something like:

var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("MyApp.Resources.Aspose.Cells.lic");
license.SetLicense(stream);

Hope, the above detail might help you to find out the license file on Azure.

Please note, after your license (subscription) expires, the license will not stop the library from working even after 31st July 2025 unless you update/use Aspose library/APIs version which is/will be released after this date.

Thank you Amjad, I managed to find the license location. If my license only expires end of July am i able to update it now or do I need to wait until the date it expires and then update?

@ttseabi,

Sure, you may update it at your convenience. It is entirely up to you whether you choose to upgrade your subscription before or after the license expiration date. However, upgrading now (before your (license) subscription expires) offers the advantage of seamlessly updating Aspose APIs/libraries at any time during the next whole year, without encountering any interruptions or (error) messages.

Ok put in my new license file and it doesn’t seem to work, does it mean I need to wait for the 30th? on the day it expires?

@ttseabi,

Could you please clarify what you meant when you mentioned that replacing the older license with a new one in the Azure app does not work? Are you encountering any specific errors, exceptions, or other issues? Please provide detailed information along with the complete error trace so we can review it soon.

Hi,
The current license which is due to expire end of this month is currently saved in our wwwroot directory,what I did was make a back up of the current license file and then pasted the new license file in the same directory. But as soon as I pasted the new license file in the same directory now the integration with Aspose is failing it just shows “Inner Exception Error” on our logs. How it is supposed to work is that whenever a document is sent to Aspose from our application it must get stamped and then sent back to us. Currently this functionality works with the current license which is due to expire end of this month, but as soon as we put in the new license this functionality doesn’t work, is there a way maybe to verify if the license we received is valid?

@ttseabi,

Kindly ensure that the license file name matches the previous one. If it differs, you may rename the new file to match the old name. Alternatively, if you prefer not to rename the file, please review the relevant lines of code where the license is set using SetLicense method, and confirm or update the file path to point to the new license file. If the issue persists, we kindly request you to share the complete error stack, as the “Inner Exception Error” does not provide sufficient information to identify the problem.

Thank you, please see the error that we are seeing

Aspose _ result::{“Message”:“An error has occurred.”,“ExceptionMessage”:“Invalid license signature. Please make sure the license file was not modified.”,“ExceptionType”:“System.InvalidOperationException”,

The error indicates that the license file might have been either corrupted or modified in your environment. Here are a few steps to help resolve the issue:

  1. Kindly ensure that the license file has not been altered. You may wish to debug this on your end by comparing the original license file’s content with the processed content after setting the license in your code.

  2. Please note that the .lic file must remain exactly as it was received. Even a minor change, such as adding or updating a single character or space, could render the license invalid.

  3. Verify that the license file has been deployed correctly in your environment.

Additionally, to confirm whether the license file is functioning as expected, you can create a simple console application on your local machine. Within this application, set the license in your code using the physical file path, create a new workbook, add text to a worksheet cell, and save the Excel file. If no exceptions occur and the generated file appears fine, this would suggest the issue lies in the configuration or the way the license is being set up on Azure. This approach may help you identify and address the problem accordingly.