Pre loader

License in DLL

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

0
0

Where do I call SetRuntimeLicenseKey in a C# DLL?

Dan Kary

Version
4.0.6.8482
  • You must to post comments
1
0

Hi Dan,

I know we’ve answered this as a support ticket, but for the benefit of the SciChart WPF Community, here is the answer:

As per our Activating SciChart article, the SciChartSurface.SetRuntimeLicenseKey() method needs to be called once, and once only before any SciChartSurface instance is created.

In multi-DLL applications or where you have Prism modules dynamically loaded, we recommend creating a class to handle license management and initializing licensing in the entry point to the module. For example:

// Declare such a class
public static class SciChartLicensingHelper
{
     private static bool _isInit = false;
     private static readonly object _syncRoot = new object();

     public static void InitializeLicense()
     {
         lock(_syncRoot)
         {
              if (_isInit) return;

             SciChartSurface.SetRuntimeLicenseKey(@"<YourLicenseKey>");
             _isInit = true;
         }
     }
}

// Call in your module entry point as follows
SciChartLicensingHelper.InitalizeLicense();

Using this code you can call SciChartLicensingHelper.InitalizeLicense() as many times as you wish and it will be called only once. This should resolve any issues in multi-module or complex applications.

Best regards,
Andrew

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies