Applying IronPDF License Key to Projects

This article was translated from English: Does it need improvement?
Translated
View the article in English

许可证密钥是一个以许可证支持到期日期结尾的长字符串。 请确保正确复制。

IRONPDF-MYLICENSE-KEY-1EF01-EXPIRES.01.JAN.2050

许可证密钥字符串中的任何额外空格或字符都将导致以下错误:

Unhandled exception. IronSoftware.Exceptions.LicensingException: IronPDF must be licensed for development.

应用许可证密钥的最可靠方法是在调用库之前直接在代码中。

// Set the license key for IronPDF before making any calls to the library.
IronPdf.License.LicenseKey = "IRONPDF-MYLICENSE-KEY-EXPIRES.01.JAN.2050";
// Set the license key for IronPDF before making any calls to the library.
IronPdf.License.LicenseKey = "IRONPDF-MYLICENSE-KEY-EXPIRES.01.JAN.2050";
' Set the license key for IronPDF before making any calls to the library.
IronPdf.License.LicenseKey = "IRONPDF-MYLICENSE-KEY-EXPIRES.01.JAN.2050"
$vbLabelText   $csharpLabel

{i:(从IronPdf版本2024.1.20开始,用户需要至少拥有一个免费的[试用许可证密钥]才能在他们的项目中使用IronPDF库。 项目中缺少许可证密钥将引发上述的LicensingException错误。)}]

有关更多选项,包括web.configappsettings.json,请参阅以下操作页面以获取更多信息:IronPDF许可证密钥

Curtis Chau
技术作家

Curtis Chau 拥有卡尔顿大学的计算机科学学士学位,专注于前端开发,精通 Node.js、TypeScript、JavaScript 和 React。他热衷于打造直观且美观的用户界面,喜欢使用现代框架并创建结构良好、视觉吸引力强的手册。

除了开发之外,Curtis 对物联网 (IoT) 有浓厚的兴趣,探索将硬件和软件集成的新方法。在空闲时间,他喜欢玩游戏和构建 Discord 机器人,将他对技术的热爱与创造力相结合。

准备开始了吗?
Nuget 下载 16,154,058 | 版本: 2025.11 刚刚发布