C1.C1Excel.4.5.2 doesn’t work anymore in a Windows Service

Posted by: CEymer on 5 April 2022, 5:23 am EST

    • Post Options:
    • Link

    Posted 5 April 2022, 5:23 am EST

    Hi all,

    I tested version 2021v3 (532) and version 2022v1 (548) of the WinForms Edition. In both versions I can’t use the C1Excel component in a Windows Service anymore.

    This is the exception I get:

    System.InvalidOperationException: Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation.

    The component worked fine in all previous versions.

    Thank you very much for help,

    Christian

  • Posted 5 April 2022, 6:11 am EST

    Hi again,

    in this Windows Service I load an Excel file from Database, and search the rows and columns of a sheet for some data to calculate statistics for our transports and logistics software.

    The exception occurs in the line, where the C1XLBook is created:

    var c1xls = new C1.C1Excel.C1XLBook();
    

    Thank you,

    Christian

  • Posted 6 April 2022, 1:22 am EST

    Hi Christian,

    Could you please let us know the exact version of C1 Controls you were using before testing the versions 2021v3 (532) and 2022v1 (548)?

    FYI, After the 2020v2 release, we have updated our licensing model. The previous model used a licenses.licx file to license an application. But the new licensing model uses a runtime license ([Application_Name].gclicx file) as an embedded resource in your application to properly license the application.

    If you were using a version older than the 2020v2 release, then the issue you are facing might be observed when you use the newer version of C1 controls without the embedded runtime license, which results in a popup form showing that your application is not licensed. Since you are using the C1 controls in a Windows Service Application, the application is not allowed to show any UI popups resulting in the exception you have mentioned. If you are upgrading from a version older than the 2020v2 release, we suggest you embed the runtime license in your service application and see if the issue still persists.

    Please refer to the link below for steps to generate a runtime license.

    https://www.grapecity.com/componentone/docs/license/online-license/create-runtime-license.html

    Also, if you are using a class library in your application with an older version of controls, you will need to follow some extra steps to generate runtime licenses for these class libraries as well. Please refer to the link below showing these steps in detail.

    https://www.grapecity.com/componentone/docs/license/online-license/license-user-controls.html

    Kind Regards,

    Kartik

  • Posted 6 April 2022, 5:56 am EST

    Hi Kartik,

    Thank you very much for your help. The exception was caused by the licensing model and the resulting popup form. We are using a class library in our Windows Service, thank you for your helpful links. Now the Windows Service works again.

    Kind Regards,

    Christian

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels