License compatibility

Posted by: serge.barrouilhet on 20 February 2025, 5:15 am EST

    • Post Options:
    • Link

    Posted 20 February 2025, 5:15 am EST - Updated 20 February 2025, 5:20 am EST

    Hello,

    In an assembly (A1) we use “C1.C1Excel.4.dll”.

    We’ve created a Winform application with the .Net 4.7.2 framework that uses the previous assembly.

    In this application, we’ve added the “licenses.licx” file.

    We’re now trying to create a new Winform application with the .NET 8 framework using assembly A1.

    Similarly, in this application, we’ve added the “licenses.licx” file.

    However, when we run this new application, we get the following error message:

    “Evaluation version. …”

    In addition, in the project of this new application, we have these alerts:

    “This package may not be fully compatible with you. …”

    Thank you in advance for your reply.

  • Posted 21 February 2025, 7:14 am EST

    Hi,

    first of all: your assembly “A1” should create outputs for two target frameworks (NET 4.7 and .NET 8), so it has to be a SDK style project.

    It should reference the latest version of C1.Excel: https://www.nuget.org/packages/C1.Excel

    Recently there were changes and the .NET 4 and .NET 8 versions of the old “C1Excel” were joined to a single package. With older versions, you might need to different references:

    Second: your application does not require a “license.licx” file. In .NET8, it is no longer used, as the framework removed the old licensing code. Now, a runtime license (“.gclicx” file) is generated when building the project.

    Is your assembly “A1” referenced as a Nuget package, or do you reference a dll file directly?

    But I think the C1 license generator cannot generate licenses for C1 components contained in dll files. So, the easiest workaround should be to add a dummy C1Exel code call to your application.

    This reply is only a superficial description of the steps to handle your situation. Depending on your current project state, I can give more details.

    Best regards

    Wolfgang

  • Posted 24 February 2025, 12:24 am EST

    Hi Serge,

    As @Wolfgang mentioned, you have to refer to the C1.Excel package in your .NET8 application: https://www.nuget.org/packages/C1.Excel

    There might be some API differences between v4.0 and v8 of the ComponentOne Excel DLL, therefore we suggest you modify your implementation based on these differences.

    Again, using C1 components in a NET8 application requires a runtime license gclicx file, embedded in your

    project. When you drop a C1 component into the designer, it gets created automatically. Otherwise, you can also consider creating the license by referring to the following documentation link: https://developer.mescius.com/componentone/docs/license/online-license/create-runtime-license.html

    In case you need further help, then please share your project architecture and provide details on how you are consuming the C1 components in your project.

    PS: Thanks @Wolfgang for sharing your insights.

    Kind Regards,

    Aastha

  • Posted 24 February 2025, 10:24 am EST

    Hi,

    @Wolfgang & @Aastha, thank you for your answers.

    I’ve added a quick example of what’s going on.

    Thank you in advance for your replies.

    UseC1Excel.zip

  • Posted 24 February 2025, 11:28 am EST

    Hi Serge,

    I converted “ClassUseC1Excel” to SDK style so that it supports both .NET 4.7 and .NET 8 builds, then added Nuget package references to the latest C1.Excel package.

    UseC1Excel_Update1.zip

    The console application works fine now.

    But the .NET 4.7 WinForms application does not build:

    Exception occurred creating type 'C1.Excel.C1XLBook, C1.Excel, Version=8.0.20242.129, Culture=neutral, PublicKeyToken=6b66a9e217bdeae0' System.UnauthorizedAccessException: The ComponentOne license key is invalid or missing.

    @Aastha I cannot help further, could you take a look?

    Best regards

    Wolfgang

  • Posted 26 February 2025, 7:35 pm EST - Updated 26 February 2025, 7:40 pm EST

    Hi Serge,

    As per our understanding, you have a .Net framework 4.7.2 class library that uses C1Excel v4.0 DLLs. Your requirement is to upgrade this project to .NET8.

    In order to achieve this requirement, we suggest you follow the steps below:

    1. Upgrade your .NET Framework 4.7.2 class library to .NET8 class library using .NET upgrade assistant. https://learn.microsoft.com/en-us/dotnet/core/porting/upgrade-assistant-how-to-upgrade (We created a side-by-side upgrade for your reference.)

    2. NET8 projects does not support v4.0 libraries. Therefore, you have to remove the v4.0 libraries from the upgraded NET8 project.

    3. Install C1.Excel v8 package to the updated project. https://www.nuget.org/packages/C1.Excel

    4. Make the required changes in your project based on the differences in the new API used. Refer updateReferences.gif to see the changes we made at our end.

    1. Now you can consume this DLL in a NET8 project. Make sure that you create a runtime license for this use case. https://developer.mescius.com/componentone/docs/license/online-license/license-user-controls.html

    For our project, we created the runtime license as shown below:

    1. You will also need to install C1.Excel v8 package in your host application.

    Kindly refer to the attached sample to see our implementation. ExcelLibUpd.zip

    Hope this helps you!

    Thanks & regards,

    Aastha

  • Posted 27 February 2025, 4:29 am EST

    @aastha.gupta did you take a look at my attempt to convert Serge’s sample (previous post, attachment “UseC1Excel_Update1.zip”)? I could not make the .NET 4.7 winforms application compile.

    Based on your previous reply, I added a nuget package reference to “C1.Excel” to the winforms app, and also added a C1Excel usage to the code of the form, but the error did not disappear.

    Seems your previous post used another project structure than the one of Serge.

    But after removing the “license.licx” file from the “WinFormUseC1Excel” project, I could make it run. @Serge maybe this is the way to go.

    Best regards

    Wolfgang

  • Posted 28 February 2025, 7:48 am EST - Updated 28 February 2025, 7:53 am EST

    Hi @Wolfgang,

    We sincerely apologize that we missed your suggestion earlier. Your approach to converting “ClassUseC1Excel” to SDK style looks like the best way to meet the customer’s needs.

    Hi @Serge,

    Since we have a standard C1Excel library for both target frameworks, you can proceed with Wolfgang’s suggested approach.

    Just a quick note: If you’re using this class library in a .NET Framework application, you’ll need to embed a runtime license (.gclicx) file in the project, as a .licx file won’t work. You can find more details here: https://developer.mescius.com/componentone/docs/license/online-license/create-runtime-license.html

    For your project, we recommend creating a gclicx file (as shown in the attached snapshot) and embedding it in the “ClassUseC1Excel” project.

    @Wolfgang, thanks again for your help.

    Kind regards,

    Aastha

  • Posted 28 February 2025, 8:31 am EST

    @Asstha Thanks for the clarification. This explains why it worked after removing the license.licx file - afterwards the runtime license was automatically generated. I thought that .NET framework projects still require a license.licx file.

    Best regards

    Wolfgang

Need extra support?

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

Learn More

Forum Channels