Licensing NUnit test projects

Posted by: slidonnici on 24 November 2023, 12:21 am EST

    • Post Options:
    • Link

    Posted 24 November 2023, 12:21 am EST

    Hello,

    we have a .NET 6 library using AR17 reports. We need to test some other internal libraries that use this dll, but we always get a “System.ComponentModel.LicenseException : This application will be terminated because it was built without a license for SectionReport” even if the dll has been built on a licensed machine.

    I have tried to add a licenses.licx file to the .NET 6 library, bit it doesn’t compile anymore, giving errors due to missing assemblies.

    How can we license the dll so that it can be tested in NUnit test projects? Can the procedure for Azure Functions be used to license a dll instead of the executable of an application?

    Thanks

  • Posted 27 November 2023, 10:27 pm EST

    Hi Sergio,

    For the .NET Core Test project, the entry assembly name is ‘testhost’, generating a ‘.gclicx’ license file using the following command:

    C:\ProgramData\GrapeCity\gclm>gclm.exe "742a5cf8-2204-4873-9dc9-ff56d67411bd" -lc ./.gclicx "testhost.[TestProjectAssemblyName].dll"
    

    And embedding the generated ‘.gclicx’ license file into the test project will run the Tests as expected.

    Regards,

    Anand

  • Posted 6 December 2023, 2:50 am EST

    Hello Anand and thanks for your answer. I’ve tried as explained and it now works for tests running in Visual Studio with the NUnit3TestAdapter. Unfortunately it does not work for tests executed from the command line through nunit3-console.exe. I’ve already tried replacing ‘testhost’ with ‘nunit3-console’:

    C:\ProgramData\GrapeCity\gclm>gclm.exe "742a5cf8-2204-4873-9dc9-ff56d67411bd" -lc ./.gclicx "nunit3-console.[TestProjectAssemblyName].dll"

    but it still throws the System.ComponentModel.LicenseException. Do you have any suggestion?

    Thanks

    Sergio

  • Posted 6 December 2023, 8:45 am EST

    Hi Anand,

    I’ve managed to find a solution, the assembly name for the console is ‘nunit-agent.dll’.

    Regards,

    Sergio

  • Posted 6 December 2023, 2:08 pm EST

    Hi Sergio,

    We are glad that your issue has been resolved. Feel free to get back to us in case of any issues.

Need extra support?

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

Learn More

Forum Channels