syncfusion-winforms-licensing
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseImplementing Syncfusion Windows Forms Licensing
实现Syncfusion Windows Forms许可
This skill provides comprehensive guidance for implementing and managing Syncfusion licensing in Windows Forms applications, including license key generation, registration, troubleshooting, and CI/CD integration.
本指南为在Windows Forms应用中实现和管理Syncfusion许可提供全面指导,包括许可密钥生成、注册、问题排查以及CI/CD集成。
When to Use This Skill
什么时候使用本指南
Use this skill immediately when you need to:
- Implement licensing in a Windows Forms application using Syncfusion components
- Resolve license validation errors or trial expiration messages
- Generate license keys for specific versions and platforms
- Register license keys in C# or VB.NET Windows Forms applications
- Troubleshoot licensing issues such as invalid keys, platform mismatches, or version mismatches
- Configure CI/CD pipelines with license validation (Azure Pipelines, GitHub Actions, Jenkins)
- Understand licensing requirements for NuGet packages, trial installers, or licensed installers
- Upgrade from trial to licensed version after purchasing
- Handle build server licensing scenarios
当你需要完成以下操作时可直接使用本指南:
- 在使用Syncfusion组件的Windows Forms应用中实现许可配置
- 解决许可验证错误或试用到期提示
- 为特定版本和平台生成许可密钥
- 在C#或VB.NET Windows Forms应用中注册许可密钥
- 排查许可问题,例如无效密钥、平台不匹配、版本不匹配等
- 配置CI/CD流水线的许可验证(Azure Pipelines、GitHub Actions、Jenkins)
- 了解NuGet包、试用安装包、正式安装包的许可要求
- 购买许可后从试用版升级到正式版
- 处理构建服务器许可相关场景
Overview of Syncfusion Licensing
Syncfusion许可概述
Starting with version 16.2.0.x, Syncfusion introduced a new licensing system that requires license key registration for:
- Applications using evaluation installers
- Applications referencing Syncfusion NuGet packages from nuget.org
Key Points:
- License keys are version and platform specific
- License keys are different from installer unlock keys
- Validation happens offline during application execution (no internet required)
- Licensed installer users do not need to register license keys
- Trial license keys expire after 30 days
从16.2.0.x版本开始,Syncfusion推出了新的许可系统,以下场景需要注册许可密钥:
- 使用评估版安装包的应用
- 引用了nuget.org上Syncfusion NuGet包的应用
核心要点:
- 许可密钥是版本和平台特定的
- 许可密钥与安装包解锁密钥不同
- 验证在应用运行时离线完成(无需联网)
- 使用正式版安装包的用户无需注册许可密钥
- 试用许可密钥30天后到期
Documentation and Navigation Guide
文档与导航指南
Understanding Licensing
了解许可体系
📄 Read: references/licensing-overview.md
When to read this reference:
- Understanding the licensing system introduced in version 16.2.0.x
- Learning the difference between unlock keys and license keys
- Determining when license registration is required
- Understanding build server scenarios (NuGet vs Trial vs Licensed installers)
- Learning about version and platform specificity
📄 阅读: references/licensing-overview.md
适用场景:
- 了解16.2.0.x版本引入的许可系统
- 学习解锁密钥和许可密钥的区别
- 确定什么时候需要注册许可
- 了解构建服务器场景(NuGet、试用安装包、正式安装包的区别)
- 学习版本和平台特定性规则
Generating License Keys
生成许可密钥
📄 Read: references/license-generation.md
When to read this reference:
- Generating license keys from License & Downloads section
- Generating license keys from Trial & Downloads section
- Using the Claim License Key feature
- Handling active license scenarios
- Handling active trial scenarios
- Dealing with expired licenses
- Starting a trial when no license exists
📄 阅读: references/license-generation.md
适用场景:
- 从「许可与下载」板块生成许可密钥
- 从「试用与下载」板块生成许可密钥
- 使用申领许可密钥功能
- 处理有效许可场景
- 处理有效试用场景
- 处理过期许可问题
- 无许可时开启试用
Registering License Keys
注册许可密钥
📄 Read: references/license-registration.md
When to read this reference:
- Implementing the RegisterLicense method in C# or VB.NET
- Registering keys in Main() method for C# applications
- Registering keys in Application.Designer.vb for VB.NET
- Registering keys in Program.vb for VB.NET
- Understanding Syncfusion.Licensing.dll reference requirements
- Learning about offline validation capabilities
📄 阅读: references/license-registration.md
适用场景:
- 在C#或VB.NET中实现RegisterLicense方法
- 在C#应用的Main()方法中注册密钥
- 在VB.NET的Application.Designer.vb中注册密钥
- 在VB.NET的Program.vb中注册密钥
- 了解Syncfusion.Licensing.dll的引用要求
- 学习离线验证能力
Troubleshooting Licensing Errors
排查许可验证错误
📄 Read: references/licensing-errors.md
When to read this reference:
- Resolving "License key not registered" errors
- Fixing "Invalid key" errors
- Handling "Trial expired" messages
- Resolving platform mismatch errors
- Fixing version mismatch errors
- Troubleshooting "Could not load Syncfusion.Licensing.dll" errors
- Configuring Copy Local settings
- Understanding legacy errors (v16.2.0 - v20.3.0)
📄 阅读: references/licensing-errors.md
适用场景:
- 解决「未注册许可密钥」错误
- 修复「无效密钥」错误
- 处理「试用已到期」提示
- 解决平台不匹配错误
- 修复版本不匹配错误
- 排查「无法加载Syncfusion.Licensing.dll」错误
- 配置复制本地(Copy Local)设置
- 了解旧版本错误(v16.2.0 - v20.3.0)
Common Questions and CI/CD Integration
常见问题与CI/CD集成
📄 Read: references/licensing-faqs.md
When to read this reference:
- Implementing CI/CD license validation (Azure Pipelines, GitHub Actions, Jenkins)
- Using LicenseKeyValidator utility in build pipelines
- Understanding where to get license keys
- Checking if internet connection is required for validation
- Upgrading from trial to licensed version
- Registering Syncfusion account for NuGet.org users
- Understanding license key specificity
📄 阅读: references/licensing-faqs.md
适用场景:
- 实现CI/CD许可验证(Azure Pipelines、GitHub Actions、Jenkins)
- 在构建流水线中使用LicenseKeyValidator工具
- 了解获取许可密钥的渠道
- 确认验证是否需要联网
- 从试用版升级到正式版
- 为NuGet.org用户注册Syncfusion账号
- 了解许可密钥的特定性规则
Quick Start Example
快速入门示例
Here's a complete example of registering a Syncfusion license key in a Windows Forms application:
以下是在Windows Forms应用中注册Syncfusion许可密钥的完整示例:
C# Example
C#示例
csharp
using System;
using System.Windows.Forms;
using Syncfusion.Licensing;
namespace MyWindowsFormsApp
{
static class Program
{
[STAThread]
static void Main()
{
// Register Syncfusion license key BEFORE any Syncfusion control is initiated
SyncfusionLicenseProvider.RegisterLicense("YOUR_LICENSE_KEY_HERE");
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}csharp
using System;
using System.Windows.Forms;
using Syncfusion.Licensing;
namespace MyWindowsFormsApp
{
static class Program
{
[STAThread]
static void Main()
{
// Register Syncfusion license key BEFORE any Syncfusion control is initiated
SyncfusionLicenseProvider.RegisterLicense("YOUR_LICENSE_KEY_HERE");
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}VB.NET Example (Application.Designer.vb)
VB.NET示例(Application.Designer.vb)
vb
Namespace My
Partial Friend Class MyApplication
Public Sub New()
MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows)
' Register Syncfusion License
Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("YOUR_LICENSE_KEY_HERE")
Me.IsSingleInstance = False
Me.EnableVisualStyles = True
Me.SaveMySettingsOnExit = True
Me.ShutdownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses
End Sub
End Class
End Namespacevb
Namespace My
Partial Friend Class MyApplication
Public Sub New()
MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows)
' Register Syncfusion License
Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("YOUR_LICENSE_KEY_HERE")
Me.IsSingleInstance = False
Me.EnableVisualStyles = True
Me.SaveMySettingsOnExit = True
Me.ShutdownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses
End Sub
End Class
End NamespaceCommon Patterns
通用模式
Pattern 1: License Key Registration Workflow
模式1:许可密钥注册流程
When implementing Syncfusion licensing:
- Generate license key from Syncfusion account
- Add reference to Syncfusion.Licensing.dll
- Register license key at application entry point (before any Syncfusion control initialization)
- Verify no license validation errors appear
实现Syncfusion许可时遵循以下步骤:
- 从Syncfusion账户生成许可密钥
- 添加Syncfusion.Licensing.dll引用
- 在应用入口点注册许可密钥(在任何Syncfusion控件初始化之前)
- 验证无许可验证错误出现
Pattern 2: Troubleshooting License Errors
模式2:许可错误排查流程
When encountering license validation errors:
- Identify the specific error message
- Verify license key is for correct version and platform
- Check registration location (must be before control initialization)
- Ensure Syncfusion.Licensing.dll is referenced and Copy Local = True
- Regenerate license key if needed
遇到许可验证错误时遵循以下步骤:
- 识别具体错误信息
- 验证许可密钥匹配正确的版本和平台
- 检查注册位置(必须在控件初始化之前)
- 确认已引用Syncfusion.Licensing.dll且复制本地(Copy Local)= True
- 如有需要重新生成许可密钥
Pattern 3: CI/CD License Validation
模式3:CI/CD许可验证流程
When implementing license validation in CI pipelines:
- Download LicenseKeyValidator utility
- Configure PowerShell script with platform, version, and license key
- Integrate script execution in CI pipeline (Azure, GitHub Actions, Jenkins)
- Validate license before deployment
- Handle validation failures appropriately
在CI流水线中实现许可验证时遵循以下步骤:
- 下载LicenseKeyValidator工具
- 配置包含平台、版本和许可密钥的PowerShell脚本
- 将脚本执行集成到CI流水线(Azure、GitHub Actions、Jenkins)
- 在部署前验证许可有效性
- 适当处理验证失败情况
Pattern 4: Upgrading from Trial to Licensed
模式4:试用版升级正式版流程
When purchasing a license after trial:
- Option A: Uninstall trial, install licensed version from License & Downloads
- Option B: (For NuGet users) Replace trial license key with paid license key
- Verify license registration in application
- Test to ensure no trial messages appear
试用后购买许可时遵循以下步骤:
- 方案A: 卸载试用版,从「许可与下载」安装正式版
- 方案B:(NuGet用户适用)将试用许可密钥替换为付费许可密钥
- 验证应用中的许可注册生效
- 测试确保没有试用提示出现
Key Concepts
核心概念
License Key Characteristics
许可密钥特性
- Version-specific: License key must match Syncfusion assembly version
- Platform-specific: Windows Forms keys only work for Windows Forms platform
- Offline validation: No internet connection required during runtime
- String format: License key is a string registered via RegisterLicense()
- 版本特定: 许可密钥必须匹配Syncfusion程序集版本
- 平台特定: Windows Forms密钥仅适用于Windows Forms平台
- 离线验证: 运行时无需互联网连接
- 字符串格式: 许可密钥是通过RegisterLicense()方法注册的字符串
Registration Requirements
注册要求
| Assembly Source | License Registration Required? | Where to Get Key |
|---|---|---|
| NuGet packages from nuget.org | ✅ Yes | License & Downloads / Trial & Downloads |
| Trial installer | ✅ Yes | Trial & Downloads |
| Licensed installer | ❌ No | Not applicable |
| 程序集来源 | 是否需要注册许可? | 密钥获取渠道 |
|---|---|---|
| nuget.org上的NuGet包 | ✅ 是 | 许可与下载 / 试用与下载 |
| 试用安装包 | ✅ 是 | 试用与下载 |
| 正式安装包 | ❌ 否 | 不适用 |
Critical Registration Rules
关键注册规则
- Timing: Register license key BEFORE initializing any Syncfusion control
- Location:
- C#: In method before
Main()Application.Run() - VB.NET: In constructor or
Application.Designer.vbProgram.vb
- C#: In
- Dependencies: Ensure is referenced with Copy Local = True
Syncfusion.Licensing.dll - Format: Place license key string between double quotes
- 时机: 在初始化任何Syncfusion控件之前注册许可密钥
- 位置:
- C#:在方法中,
Main()之前Application.Run() - VB.NET:在构造函数或
Application.Designer.vb中Program.vb
- C#:在
- 依赖: 确保已引用且复制本地(Copy Local)= True
Syncfusion.Licensing.dll - 格式: 将许可密钥字符串放在双引号之间
Common Use Cases
常见使用场景
Use Case 1: First-Time Syncfusion License Setup
场景1:首次配置Syncfusion许可
Scenario: Developer setting up Syncfusion in a new Windows Forms project using NuGet packages.
Approach:
- Read references/licensing-overview.md to understand requirements
- Read references/license-generation.md to generate key
- Read references/license-registration.md to implement registration
- Test application to verify no license errors
场景: 开发者在使用NuGet包的新Windows Forms项目中配置Syncfusion。
操作步骤:
- 阅读references/licensing-overview.md了解要求
- 阅读references/license-generation.md生成密钥
- 阅读references/license-registration.md实现注册
- 测试应用确认无许可错误
Use Case 2: Resolving License Validation Error
场景2:解决许可验证错误
Scenario: Application shows "License key not registered" or "Invalid key" error.
Approach:
- Read references/licensing-errors.md to identify specific error
- Verify license key version and platform match
- Check registration code location and timing
- Regenerate license key if needed
- Verify Syncfusion.Licensing.dll reference
场景: 应用显示「未注册许可密钥」或「无效密钥」错误。
操作步骤:
- 阅读references/licensing-errors.md识别具体错误
- 验证许可密钥版本和平台匹配
- 检查注册代码的位置和时机
- 如有需要重新生成许可密钥
- 验证Syncfusion.Licensing.dll引用正常
Use Case 3: Build Server Configuration
场景3:构建服务器配置
Scenario: Setting up Syncfusion licensing for automated builds or CI/CD.
Approach:
- Read references/licensing-overview.md build server section
- Determine if license registration is required based on assembly source
- Read references/licensing-faqs.md CI/CD section for pipeline setup
- Implement license validation in CI pipeline
- Test build process
场景: 为自动化构建或CI/CD配置Syncfusion许可。
操作步骤:
- 阅读references/licensing-overview.md的构建服务器部分
- 根据程序集来源确定是否需要注册许可
- 阅读references/licensing-faqs.md的CI/CD部分配置流水线
- 在CI流水线中实现许可验证
- 测试构建流程
Use Case 4: Trial to Licensed Upgrade
场景4:试用版升级正式版
Scenario: Developer purchased license after using trial version.
Approach:
- Read references/licensing-faqs.md upgrade section
- Choose upgrade approach (reinstall or key replacement)
- Generate new paid license key
- Update registration code with new key
- Verify trial message is removed
场景: 开发者试用后购买了正式许可。
操作步骤:
- 阅读references/licensing-faqs.md的升级部分
- 选择升级方案(重新安装或替换密钥)
- 生成新的付费许可密钥
- 使用新密钥更新注册代码
- 验证试用提示已移除
Use Case 5: Version Upgrade
场景5:版本升级
Scenario: Upgrading Syncfusion components to a new version.
Approach:
- Generate new license key for target version from License & Downloads
- Update NuGet packages or installer to new version
- Replace old license key with new version-specific key
- Test application to ensure compatibility
- If errors occur, read references/licensing-errors.md
场景: 将Syncfusion组件升级到新版本。
操作步骤:
- 从「许可与下载」生成目标版本的新许可密钥
- 将NuGet包或安装包升级到新版本
- 将旧许可密钥替换为新版本特定的密钥
- 测试应用确保兼容性
- 如出现错误,阅读references/licensing-errors.md
Additional Resources
额外资源
- Syncfusion Account: https://www.syncfusion.com/account/manage-trials/downloads
- License & Downloads: https://www.syncfusion.com/account/downloads
- Support: https://support.syncfusion.com/
Summary
总结
This skill covers the complete lifecycle of Syncfusion Windows Forms licensing:
- Understanding licensing requirements and scenarios
- Generating license keys for specific versions and platforms
- Registering license keys in C# and VB.NET applications
- Troubleshooting common licensing errors
- Implementing CI/CD license validation
- Handling trial and licensed version transitions
Always start by reading the appropriate reference file based on your specific need (overview, generation, registration, errors, or FAQs).
本指南涵盖Syncfusion Windows Forms许可的完整生命周期:
- 了解许可要求和适用场景
- 生成特定版本和平台的许可密钥
- 在C#和VB.NET应用中注册许可密钥
- 排查常见许可错误
- 实现CI/CD许可验证
- 处理试用版与正式版的切换
请始终根据你的具体需求先阅读对应的参考文档(概述、生成、注册、错误排查或常见问题)。