Example 
The license key string, or null = don't set license (just initialize libraries)
A temporary directory used to write native dependencies before loading or null = default. Make sure your application has write permission to this directory and AntiVirus is not blocking access to this directory.
LoadLibrariesAndLicenseAsync Method (SciChart2DInitializer)

Applies a runtime license key and initialize 2D native libraries asynchronously. Do not create an instance of a SciChartSurface until the Task has returned and completed. If the task faults, inspect the result and contact tech support.

If you want to load libraries and license for both 2D & 3D charts, then use the related class SciChart2D3DInitializer instead

Syntax
public static Task LoadLibrariesAndLicenseAsync( 
   string runtimeLicenseKey,
   string tempFilesDirectory
)

Parameters

runtimeLicenseKey
The license key string, or null = don't set license (just initialize libraries)
tempFilesDirectory
A temporary directory used to write native dependencies before loading or null = default. Make sure your application has write permission to this directory and AntiVirus is not blocking access to this directory.
Example
try
{
   // call SciChart2DInitializer.LoadLibrariesAndLicenseAsync once before creating a SciChartSurface
   // and await the result. Do not instantiate a SciChartSurface until it returns successfully
            
   // optionalTempDir allows you to pass in an optional temporary directory for native library loading
   await SciChart2DInitializer.LoadLibrariesAndLicenseAsync("your-runtime-license-key", optionalTempDir);
            
   var sciChartSurface = new SciChartSurface();
   // ... use SciChartSurface
}
catch ( Exception caught )
{
   // TODO: Log the exception or report to tech support 
   throw;
}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also