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

Welcome to the SciChart Community Forums!

Please use the forums below to ask questions about SciChart. Take a moment to read our Question asking guidelines on how to ask a good question and our support policy. We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!

Please note: SciChart team will only answer questions from customers with active support subscriptions. Expired support questions will be ignored. If your support status shows incorrectly, contact us and we will be glad to help.

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.