SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, iOS Chart, Android Chart and JavaScript Chart Components


Where do I call SetRuntimeLicenseKey in a C# DLL?

Dan Kary

  • You must to post comments

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()
              if (_isInit) return;

             _isInit = true;

// Call in your module entry point as follows

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,

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.