License Key Registration

26 May 20252 minutes to read

To ensure proper use of Syncfusion® controls, the generated license key needs to be registered before initiating any control. Use the following code snippet to register the license:

Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("YOUR LICENSE KEY");

NOTE

  • Place the license key within double quotes.
  • Ensure that Syncfusion.Licensing.dll is referenced in your project where the license key is being registered.
  • Syncfusion® license validation is done offline during application execution and does not require internet access. Apps registered with a Syncfusion® license key can be deployed on any system that does not have an internet connection.

IMPORTANT

Syncfusion® license keys can be validated during the Continuous Integration (CI) processes to ensure proper licensing and prevent licensing errors during deployment. Refer to the CI License Validation section for detailed instructions on how to implement it.

.NET MAUI

1. Registering license key in App.xaml.cs

You can register the license key in App.xaml.cs constructor before InitializeComponent(). If App constructor not available in App.xaml.cs, create the “App()” constructor in App.xaml.cs and register the license key inside the constructor.

public App()
{
	//Register Syncfusion<sup>®</sup> license
	Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("YOUR LICENSE KEY");
	
	InitializeComponent();
	
	MainPage = new AppShell();
}

2. Registering license key in MauiProgram.cs

Register the license key in MauiProgram.cs when initializing or registering any Syncfusion® controls within this file. This ensures that all controls are fully licensed and functional from the moment the application starts. Add the license registration code inside the CreateMauiApp method in MauiProgram.cs.

public static class MauiProgram
{
    public static MauiApp CreateMauiApp()
    {
        // Register the Syncfusion license key
        Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("YOUR_LICENSE_KEY");
 
        var builder = MauiApp.CreateBuilder();
        builder
            .UseMauiApp<App>()
            .ConfigureSyncfusionCore()
            .ConfigureFonts(fonts =>
            {
                fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
            });

        return builder.Build();
    }
}

NOTE

For common licensing errors, refer to this link.