We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Syncfusion license register without hardcoded

Platform: Miscellaneous |
Control: Install and Configuration
Tags: license

Syncfusion is introduced the licensing system from v16.2.0.41 for Syncfusion NuGet packages and evaluation setup. You should  generate  and register the license key  when launching  your application.


The following steps help you to register the license key in environment variable and without hardcode in your application:


1.  To register the license key in environment, please navigate to Control Panel > All Control Panel Items > System and choose Advanced system settings.


windows details


2.  Choose  Environmental variables... from the pop-up.

environment variables

3.  Select New and set the variable in user variables pop-up. Use the variable name as SyncfusionLicenseKey and value as your license key.


add variable



provide license key


4. Click Ok to complete your license key registration as environmental variable.

5. Download the batch file and extract the zip file.

6. Place the SyncfusionLicenseRegister.bat file in project file location.

7. Open your Visual studio application to apply the license.

8. Use the following code to register the Syncfusion license key from environmental variable:


You can refer to the following link, recommended files for each platform to register the Syncfusion license: 




8. Open the project properties and set the prebuild and postbuild event to replace the license key in compilation time.


PreBuild: cd "$(ProjectDir)" 

SyncfusionLicenseRegister.bat PreBuild {filepath of Syncfusion License registered code} 

PostBuild: cd "$(ProjectDir)" 

SyncfusionLicenseRegister.bat PostBuild {filepath of Syncfusion License registered code} 


Example for WPF application 


PreBuild: cd "$(ProjectDir)" 

SyncfusionLicenseRegister.bat PreBuild App.xaml.cs 

PostBuild: cd "$(ProjectDir)" 

SyncfusionLicenseRegister.bat PostBuild App.xaml.cs


9. The compiled application will run based on the registered license key.





You must log in to leave a comment
Doug Miller
Mar 14, 2021

While this removes hardwiring the license key from the source code, replacing the dummy key with the license key during compilation does not hide the key from anybody who may decompile the Blazor WebAssembly client code. Perhaps a more secure approach would be to register they key in Blazor Server and have the Blazor WebAssembly client use SignalR to communicate with the Blazor Server to authorize runtime execution.

Andrew Kessel
Feb 08, 2022

Per Doug's comment, we still need a solution that won't expose the licensing key to anyone willing to decompile the dlls.

Jeyaseelan M [Syncfusion]
Feb 09, 2022

Hi Andrew,

We have created a support ticket in your account for your query.

Please follow up.

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile