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

