Web.configでライセンスキーを設定する
この問題は、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.configファイルに保存されたキーが製品によって使用されません。
回避策
この問題を解決するには、コード内でConfigurationManagerを使用してWeb.configファイルからライセンスキーを取得し、それをLicense.LicenseKeyプロパティに適用することをお勧めします。
Example:
<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.Configuration;
// Retrieve the license key from the Web.config 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.Configuration;
// Retrieve the license key from the Web.config 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
Private licenseKey As String = ConfigurationManager.AppSettings("IronQR.LicenseKey")
' Apply the retrieved license key to the IronQR LicenseKey property
IronQR.License.LicenseKey = licenseKey




