Code not working in production. License problem?

Moved functional development code to production but my Word file is not processing. Has anyone had trouble with an Aspose license not working in production? I didn’t renew in July for another year but I’m using the same version from last year.

@jefjones2

It sounds like you are experiencing issues with your Aspose license in your production environment. Here are some steps and considerations that may help you resolve the problem:

  1. License File Path: Ensure that the path to your license file is correctly specified in your code. If the license file is not found, Aspose will operate in evaluation mode, which could lead to the issues you are encountering.

  2. Permissions: Verify that your application has the necessary permissions to access the directory where the license file is located. This is particularly important in production environments where security settings may differ from development or testing environments.

  3. Code Execution: Make sure that the licensing code is executed properly. It is common to place the license initialization code in the Application_Start or Session_Start events in the global application file. If these events are not triggered, the license may not be applied.

  4. Embedded Resource: If you are packaging your application, consider embedding the license file as a resource within your assembly. This can help ensure that the license file is always available regardless of the deployment environment. You can do this by adding the license file to your project and setting its build action to “Embedded Resource”.

  5. Error Handling: Check if you are suppressing exceptions in your code. If Aspose cannot locate the license file, it will throw an exception. Make sure to log or handle these exceptions to understand what might be going wrong.

  6. License Validity: Since you mentioned that you did not renew your license, ensure that the license you are using is still valid for the version of Aspose you are working with. If the license has expired, you will need to renew it to avoid evaluation mode restrictions.

If you continue to face issues, consider reviewing similar discussions in the Aspose support forum, as they may provide additional insights or solutions.

Sources:
[1]: Include Aspose.Words License File as an Embedded Resource in Visual Studio & Set License | Prevent Evaluation Mode
[2]: License File Not Working Anymore - Aspose Documentation

@jefjones2 Please check the following points:

  • Make sure your call to SetLicense gets executed. Step through in the debugger.
  • Make sure your code does not catch an exception thrown by Aspose.Words licensing code. For example, Aspose.Words will throw if it cannot find the license.
  • Make sure the input documents do not already have the evaluation message. Aspose.Words does not delete existing evaluation messages.
  • Make sure SetLicense is executed before you instantiate any Document object.
  • Make sure the license is applied for all Aspose products used in your project.