web.config での IronBarcode ライセンス設定
Curtis Chau
更新日: 2026年8月2日
この問題はIronBarcodeの2024.3.2バージョンで解決されています。
Exception: Unhandled exception. IronSoftware.Exceptions.LicensingException: IronBarcode must be licensed for development.
Text
以前のIronBarcodeバージョン、特に2023.4.1と2024.3.2の間のバージョンには、以下のライセンス問題が報告されています。
- ASP.NETプロジェクト
- .NET Frameworkバージョン >= 4.6.2
キーはWeb.configファイルに保存されていますが、製品によって使用されません。
回避策
この問題に対処するには、コード内でConfigurationManagerを使用してWeb.configファイルからライセンスキーを取得し、それをLicense.LicenseKeyプロパティに適用することが推奨されます。
例:
<configuration>
...
<appSettings>
<add key="IronBarCode.LicenseKey" value="IRONBARCODE-MYLICENSE-KEY-1EF01"/>
</appSettings>
...
</configuration>
XML
上記のXMLファイルを使用して、ConfigurationManagerを使ってライセンスキーの値を取得し、それをIronBarCode.License.LicenseKeyプロパティに渡すことができます。
using System.Configuration;
// Retrieve the license key from appSettings in the Web.config file
string licenseKey = ConfigurationManager.AppSettings["IronBarCode.LicenseKey"];
// Apply the retrieved license key to the IronBarCode LicenseKey property
IronBarCode.License.LicenseKey = licenseKey;Imports System.Configuration
' Retrieve the license key from appSettings in the Web.config file
Private licenseKey As String = ConfigurationManager.AppSettings("IronBarCode.LicenseKey")
' Apply the retrieved license key to the IronBarCode LicenseKey property
IronBarCode.License.LicenseKey = licenseKeyImports System.Configuration
' Retrieve the license key from appSettings in the Web.config file
Private licenseKey As String = ConfigurationManager.AppSettings("IronBarCode.LicenseKey")
' Apply the retrieved license key to the IronBarCode LicenseKey property
IronBarCode.License.LicenseKey = licenseKeyテクニカルライター
Curtis Chauは、カールトン大学でコンピュータサイエンスの学士号を取得し、Node.js、TypeScript、JavaScript、およびReactに精通したフロントエンド開発を専門としています。直感的で美しいユーザーインターフェースを作成することに情熱を持ち、Curtisは現代のフレームワークを用いた開発や、構造の良い視覚的に魅力的なマニュアルの作成を楽しんでいます。