Skip to content

Commit 967117c

Browse files
Merge pull request #1459 from syncfusion-content/ci-validation-hotfix
CI-license-validation Improvement changes - hotfix/26.2
2 parents e01acc7 + cd33e26 commit 967117c

File tree

2 files changed

+30
-8
lines changed

2 files changed

+30
-8
lines changed

wpf/Licensing/how-to-register-in-an-application.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
layout: post
33
title: Overview of Syncfusion license registration - Syncfusion
44
description: Learn here about how to register Syncfusion WPF license key for WPF application for license validation.
5-
platform: WPF
5+
platform: wpf
66
control: Essential Studio
77
documentation: ug
88
---
@@ -20,6 +20,8 @@ Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("YOUR LICENSE KEY
2020
N> * Place the license key between double quotes. Also, ensure that Syncfusion.Licensing.dll is referenced in your project where the license key is being registered.
2121
* 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.
2222

23+
I> 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] (https://help.syncfusion.com/wpf/licensing/licensing-faq/ci-license-validation) section for detailed instructions on how to implement it.
24+
2325
### WPF
2426

2527
You can register the license key in App constructor of **App.xaml.cs** in C#. 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. In Visual Basic, register the license code in **App.xaml.vb**.

wpf/Licensing/licensing-faq/CI-license-validation.md

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ margin-top: 1.5em; margin-bottom: 1.5em;
1919

2020
# Syncfusion license key validation in CI services
2121

22-
Syncfusion license key validation in CI services ensures that Syncfusion Essential Studio components are properly licensed during CI processes. Validating the license key at the CI level can prevent licensing errors during deployment. The following section shows how to validate the Syncfusion license key in CI services.
22+
Syncfusion license key validation in CI services ensures that Syncfusion Essential Studio components are properly licensed during CI processes. Validating the license key at the CI level can prevent licensing errors during deployment. Set up the continuous integration process to fail in case the license key validation fails. Validate the passed parameters and the registered license key again to resolve the issue.
23+
24+
The following section shows how to validate the Syncfusion license key in CI services.
2325

2426
* Download and extract the LicenseKeyValidator.zip utility from the following link: [LicenseKeyValidator](https://s3.amazonaws.com/files2.syncfusion.com/Installs/LicenseKeyValidation/LicenseKeyValidator.zip).
2527

@@ -45,7 +47,8 @@ Syncfusion license key validation in CI services ensures that Syncfusion Essenti
4547

4648
The following example shows the syntax for Windows build agents.
4749

48-
```bash
50+
{% tabs %}
51+
{% highlight <lang> tabtitle ="YAML" %}
4952
pool:
5053
vmImage: 'windows-latest'
5154

@@ -57,7 +60,8 @@ steps:
5760
filePath: $(LICENSE_VALIDATION) #Or the actual path to the LicenseKeyValidation.ps1 script.
5861

5962
displayName: Syncfusion License Validation
60-
```
63+
{% endhighlight %}
64+
{% endtabs %}
6165

6266
## Azure Pipelines (Classic)
6367

@@ -73,13 +77,15 @@ steps:
7377

7478
The following example shows the syntax for validating Syncfusion license key in GitHub actions.
7579

76-
```bash
80+
{% tabs %}
81+
{% highlight <lang> tabtitle ="YAML" %}
7782
steps:
7883
- name: Syncfusion License Validation
7984
shell: pwsh
8085
run: |
8186
./path/LicenseKeyValidator/LicenseKeyValidation.ps1
82-
```
87+
{% endhighlight %}
88+
{% endtabs %}
8389

8490
## Jenkins
8591

@@ -89,7 +95,8 @@ The following example shows the syntax for validating Syncfusion license key in
8995

9096
The following example shows the syntax for validating Syncfusion license key in Jenkins pipeline.
9197

92-
```bash
98+
{% tabs %}
99+
{% highlight json %}
93100
pipeline {
94101
agent any
95102
environment {
@@ -103,14 +110,27 @@ pipeline {
103110
}
104111
}
105112
}
106-
```
113+
{% endhighlight %}
114+
{% endtabs %}
107115

108116
## Validate the License Key Using ValidateLicense() Method
109117

110118
* Register the license key properly by calling RegisterLicense("License Key") method with the license key.
111119

112120
* Once the license key is registered, it can be validated by using ValidateLicense("Platform.WPF") method. This ensures that the license key is valid for the platform and version you are using. For reference please check the following example.
113121

122+
{% tabs %}
123+
{% highlight c# %}
124+
using Syncfusion.Licensing;
125+
126+
//Register Syncfusion license key
127+
Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("YOUR LICENSE KEY");
128+
129+
//Validate the registered license key
130+
bool isValid = SyncfusionLicenseProvider.ValidateLicense(Platform.WPF);
131+
{% endhighlight %}
132+
{% endtabs %}
133+
114134
![LicenseKeyValidationMethod](licensing-images/license-validation-method.png)
115135

116136
* If ValidateLicense() method returns true, registered license key is valid and can proceed with deployment.

0 commit comments

Comments
 (0)