IronPDF 故障排除 在 Web.config 中设置许可密钥 Setting License Key in Web.config Curtis Chau 更新日期:6月 1, 2025 Download IronPDF NuGet 下載 DLL 下載 Windows 安裝程式 Start Free Trial Copy for LLMs Copy for LLMs Copy page as Markdown for LLMs Open in ChatGPT Ask ChatGPT about this page Open in Gemini Ask Gemini about this page Open in Grok Ask Grok about this page Open in Perplexity Ask Perplexity about this page Share Share on Facebook Share on X (Twitter) Share on LinkedIn Copy URL Email article This article was translated from English: Does it need improvement? Translated View the article in English 自 IronPDF 版本 2024.3.3 起,此問題已被解決。 Exception: Unhandled exception. IronSoftware.Exceptions.LicensingException: IronPDF must be licensed for development. For older IronPdf versions, specifically those between versions 2023.4.4 and 2024.3.3, there is a known licensing issue in: ASP.NET 項目 .NET Framework 版本 >= 4.6.2 存儲在 Web.config 文件中的密鑰不會被產品識別和使用。 變通方法 為了解決此問題,建議在代碼中使用 ConfigurationManager 從 Web.config 文件中提取 License Key,然後將其應用於 License.LicenseKey 屬性。 範例: <configuration> ... <appSettings> <add key="IronPdf.LicenseKey" value="IRONPDF-MYLICENSE-KEY-1EF01"/> </appSettings> ... </configuration> <configuration> ... <appSettings> <add key="IronPdf.LicenseKey" value="IRONPDF-MYLICENSE-KEY-1EF01"/> </appSettings> ... </configuration> XML 透過上面提供的 XML 文件,我們可以使用 ConfigurationManager 來檢索 License Key 值並將其傳遞給 IronPdf.License.LicenseKey 屬性。 using System.Configuration; class Program { static void Main() { // Retrieve the license key from the Web.config file string licenseKey = ConfigurationManager.AppSettings["IronPdf.LicenseKey"]; // Apply the license key to the IronPdf library IronPdf.License.LicenseKey = licenseKey; // Additional processing can continue here } } using System.Configuration; class Program { static void Main() { // Retrieve the license key from the Web.config file string licenseKey = ConfigurationManager.AppSettings["IronPdf.LicenseKey"]; // Apply the license key to the IronPdf library IronPdf.License.LicenseKey = licenseKey; // Additional processing can continue here } } Imports System.Configuration Friend Class Program Shared Sub Main() ' Retrieve the license key from the Web.config file Dim licenseKey As String = ConfigurationManager.AppSettings("IronPdf.LicenseKey") ' Apply the license key to the IronPdf library IronPdf.License.LicenseKey = licenseKey ' Additional processing can continue here End Sub End Class $vbLabelText $csharpLabel Curtis Chau 立即與工程團隊聊天 技術作家 Curtis Chau 擁有卡爾頓大學計算機科學學士學位,專注於前端開發,擅長於 Node.js、TypeScript、JavaScript 和 React。Curtis 熱衷於創建直觀且美觀的用戶界面,喜歡使用現代框架並打造結構良好、視覺吸引人的手冊。除了開發之外,Curtis 對物聯網 (IoT) 有著濃厚的興趣,探索將硬體和軟體結合的創新方式。在閒暇時間,他喜愛遊戲並構建 Discord 機器人,結合科技與創意的樂趣。 準備好開始了嗎? Nuget 下載 16,154,058 | 版本: 2025.11 剛剛發布 免費 NuGet 下載 總下載量:16,154,058 查看許可證