Skip to content

License key registration in mauiprogram.cs #708

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 8, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,8 @@ public override bool FinishedLaunching(UIApplication application, NSDictionary l

## .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.

{% tabs %}
Expand All @@ -382,6 +384,36 @@ public App()
{% endhighlight %}
{% endtabs %}

### 2.) Registering License Key in MauiProgram.cs

You can 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**.

{% tabs %}
{% highlight c# %}

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();
}
}

{% endhighlight %}
{% endtabs %}

## Flutter

Register the license key in the **main method** of your example and import the ‘syncfusion_flutter_core/core.dart' library.
Expand Down