web.co/nfig における IronBarcode のライセンス設定
この問題は、IronBarcodeの2024.3.2バージョンで解決されました。
Exception: Unhandled exception. IronSoftware.Exceptions.LicensingException: IronBarcode must be licensed for development.
IronBarcodeの旧バージョン、具体的にはバージョン2023.4.1から2024.3.2の間において、以下の点で既知のライセンス上の問題があります:
- ASP.NET プロジェクト
- .NET Framework バージョン 4.6.2 以上
Web.co/nfig ファイルに保存されたキーは、本製品によって取得・使用されることはありません。
回避策
この問題に対処するには、コード内でConfigurationManagerを使用してLicense.LicenseKeyプロパティに適用することを推奨します。
例:
<configuration>
...
<appSettings>
<add key="IronBarCode.LicenseKey" value="IRONBARCODE-MYLICENSE-KEY-1EF01"/>
</appSettings>
...
</configuration>
<configuration>
...
<appSettings>
<add key="IronBarCode.LicenseKey" value="IRONBARCODE-MYLICENSE-KEY-1EF01"/>
</appSettings>
...
</configuration>
上記のXMLファイルを使用すれば、ConfigurationManagerを利用してライセンスキーの値を取得し、それをIronBarCode.License.LicenseKeyプロパティに渡すことができます。
using System.Co/nfiguration;
// Retrieve the license key from appSettings in the Web.co/nfig file
string licenseKey = ConfigurationManager.AppSettings["IronBarCode.LicenseKey"];
// Apply the retrieved license key to the IronBarCode LicenseKey property
IronBarCode.License.LicenseKey = licenseKey;
using System.Co/nfiguration;
// Retrieve the license key from appSettings in the Web.co/nfig 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
Dim licenseKey As String = ConfigurationManager.AppSettings("IronBarCode.LicenseKey")
' Apply the retrieved license key to the IronBarCode LicenseKey property
IronBarCode.License.LicenseKey = licenseKey

