Performance of generating .NET6 license during build

Posted by: wknauf on 11 October 2023, 10:42 am EST

  • Posted 11 October 2023, 10:42 am EST

    Hi C1,

    I have the impression that build time of our projects has increased. Though I am not sure at all that it is related, I noticed a lot of outputs like this in console:

    3>GrapeCity License Manager, 1.9
    3>License for ComponentOne WinForms Edition is successfully generated.
    3>GrapeCity License Manager, 1.9
    3>License for ComponentOne WinForms Edition is successfully generated.

    (as you can see, it seems to be called twice, though the project has only one target framework)

    This is called for nearly all projects in a solution with about 100 projects, so it might have a performance impact.

    With detailed logging, I see that the license manager is found in “C:\ProgramData\GrapeCity\gclm\gclm.exe”.

    Is there any chance to disable this license generating (just to compare performance with/without)? Deleting the “gclm.exe” just re-downloads it. Would it help to generate a runtime license in the project myself?

    Best regards

    Wolfgang

  • Posted 12 October 2023, 4:05 am EST

    Hi Wolfgang,

    Yes, the automatic license generation (by gclm.exe) can be disabled by setting the “DisableGclm” property to true in the .csproj file of your project.

    <PropertyGroup>
    	...
    	<DisableGclm>true</DisableGclm>
    </PropertyGroup>

    Doing this will not generate the runtime license automatically and you will need to generate it manually using the “GrapeCity” tools menu in Visual Studio. If you still face any issues, we request you to share a sample solution showing the issue, if possible.

    Best Regards,

    Kartik

  • Posted 12 October 2023, 9:32 am EST

    Thanks, this works. The build time seems to be better - there is a tendency that it is about 20 seconds faster. But the virus scanner probably also affects build time, and Visual Studio performance fluctuates.

    So, I could set this property and generate a runtime license (and commit it to TFS) for all starter projects. All utility dll projects don’t need this license I assume?

    Do you know whether web projects need a runtime license? We have a .NET6 web app that internally creates an invisible C1FlexGrid, and a C1FlexReport might be rendered and downloaded as PDF file.

    Best regards

    Wolfgang

  • Posted 15 October 2023, 10:52 am EST

    Hi Wolfgang,

    Thank you for sharing the details. If the utility DLLs use the C1 controls/components and they are then referenced in separate executables, then you will need to embed runtime licenses like (https://www.grapecity.com/componentone/docs/license/online-license/license-user-controls.html#i-heading-generate-a-run-time-license-through-visual-studio)

    Regarding the web applications, could you please let us know which platform are you using? Generally, all the C1 controls need a runtime license at the time they are initialized in code. However, the licensing can differ based on old/new platforms.

    Best Regards,

    Kartik

  • Posted 16 October 2023, 2:30 am EST

    Hi Kartik,

    about the utility dll: would it also work if the utility dll has NO runtime license, and “DisableGclm” is set in the project file, and in the application that uses it, I create a runtime license?

    The web application targets .NET6.

    Best regards

    Wolfgang

  • Posted 18 October 2023, 8:09 am EST

    Hi,

    Thanks for the information.

    If you have a Main Project and a Utility dll used in the Main project. Also, GCLM is disabled for both. Then you need to generate a runtime license for the Utility dll manually, if any of the C1 components is used in Utility dll.

    To generate a runtime license for Utility dll, You can follow the article provided by Kartik:

    https://www.grapecity.com/componentone/docs/license/online-license/license-user-controls.html#i-heading-generate-a-run-time-license-through-visual-studio

    Follow the Generate Run-Time License for User Control section.

    Just in case if you are facing any issue while generating Runtime license then please get back to us.

    Regards,

    Nitin.

  • Posted 18 October 2023, 9:30 am EST

    Hi Nitin,

    I have to admit: I could not create a valid license following the section “Generate Run-Time License for User Control”.

    But in my tests the app starts perfectly, if I set “DisableGclm” = true in the utility dll and the starter project and then generate a runtime license in the starter project, see attached sample (I removed the “gclicx” file again, as I don’t know whether it is a good idea to post them here).

    FlexLicenseTest.zip

    There seems to be no need to follow the guide to create a runtime license for the name “StarterProject.UtilityDll”, as the guide says.

    This contradicts a bit to what you said with your last reply I assume ;-).

    Best regards

    Wolfgang

  • Posted 19 October 2023, 2:28 am EST - Updated 19 October 2023, 2:39 am EST

    Hi Wolfgang,

    Apologize for the confusion. Also, thanks for providing the sample.

    Let’s take the example from the sample that you provided.

    1. Application have two projects: FlexLicenseTestMain(Main project) and FlexLicenseTestUtility(Class Library)
    2. FlexLicenseTestMain project consumes FlexLicenseTestUtility.
    3. The FlexLicenseTestMain project does not have any C1 package references included and no C1 controls are used under the FlexLicenseTestMain as well. Therefore, no need to generate a runtime license for it. It will work.
    4. But Utilitydll project(FlexLicenseTestUtility) have C1 control with C1 references. Therefore, a Runtime license is needed.
    5. As we are clear, the Utility dll project is consumed in the Main project. Then you need to generate a runtime license for the UtilityDll(By following the URL we provided earlier) but not for the Main project(As it doesn’t have any C1 References).

    1. If you run your project without a runtime license embedded in Utility dll:

    The application will run successfully. Because the Main Project is running and Utility dll is not used yet. Once you click the button to execute the code of Utility dll. It will throw Exception for No License. And it will not work in this case.

    C1License doesn’t validate on compiling or building the application. It validates once a control initializes.

    In this case, once you are running the application. No C1 controls were initialized. When you click on the button to open a form with C1 control. The License will validate this time because C1 control is initializing.

    Please refer the attached gif for the same:

    2. If you run your project with a runtime license embedded in Utility dll:

    The application will run successfully. Because the Main Project is running and Utility dll is not used yet. Once you click the button to execute the code of Utility dll. The License will validate with the runtime license embedded in it. If the runtime license is valid, it will work.

    Please refer the attached gif for the same:

    If still, you have any doubts in case of Utility dll. Then please let us know. We will try to respond ASAP.

    Best Regards,

    Nitin

  • Posted 19 October 2023, 3:22 am EST

    Hi Nitin,

    OK, now I understand how the license for utility dll works.

    But in our case, the usage of C1 components is spread across a lot of utility dlls (50+ I think), and we have several starter applications. Thus, it does not work to add a runtime license to each utility dll for each combination of starter application.

    And for me, it works if I generate a runtime license for each starter application. This is probably the same that happens if I don’t disable license generation in all projects. So, I want to confirm whether it is a valid usage to set “DisableGclm” in all utility dlls (to improve build time) and and manually generate runtime licenses in all starter applications (or don’t set “DisableGclm” and let it auto generate?

    Is it save to post a sample project with a pregenerated “gclicx” file here? Or could someone else use this file ;-)?

    Best regards

    Wolfgang

  • Posted 20 October 2023, 5:58 am EST

    Hi Wolfgang,

    Yes, you can set “DisbaleGclm” if you are getting better performance with it. There will be no issue while building the application. But make sure you have generated valid runtime licenses.

    You can share a sample with a pre-generated .gclicx file in public forums. Gclicx is an encrypted file. But we recommend, sharing the sample with pre-generated .gclicx file on Support by generating a personal Support ticket. You can generate a support ticket here: https://www.grapecity.com/my-account/my-support

    Best Regards,

    Nitin

  • Posted 20 October 2023, 2:24 pm EST

    OK, thanks.

    I will follow the approach to disable Gclm for all utility dll projects and generate a runtime license myself in all starter projects.

    Many thanks for your support on this! Hope this saves us a lot of build time - and other users might find this helpful, too.

    Best regards

    Wolfgang

  • Posted 22 October 2023, 11:43 pm EST

    Hi Wolfgang,

    Thanks for the acknowledgment.

    You can get back to us anytime if you need any help from us related to our components and licensing.

    Regards,

    Nitin

Need extra support?

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

Learn More

Forum Channels