IronPrint ライセンスの構成トラブルシューティング
問題は、IronPrint バージョン 2024.3.6 で解決されました。
Exception: Unhandled exception. IronSoftware.Exceptions.LicensingException: IronPrint must be licensed for development.
Exception: Unhandled exception. IronSoftware.Exceptions.LicensingException: IronPrint must be licensed for development.
以前のバージョンのIronPrint、特にバージョン2024.3.6より前にリリースされたものでは、以下に記載のライセンス問題が知られています:
- ASP.NET プロジェクト
-
.NET Framework バージョン >= 4.6.2
Web.config
ファイルに保存されたキーは、製品によって使用されません。
ワークアラウンド
この問題に対処するには、Web.config
ファイルからConfigurationManagerを使用してライセンスキーを取得し、それをLicense.LicenseKeyプロパティに適用することをお勧めします。
例:
<configuration>
...
<appSettings>
<add key="IronPrint.LicenseKey" value="IRONPRINT.MYLICENSE.KEY.1EF01"/>
</appSettings>
...
</configuration>
<configuration>
...
<appSettings>
<add key="IronPrint.LicenseKey" value="IRONPRINT.MYLICENSE.KEY.1EF01"/>
</appSettings>
...
</configuration>
上記のXMLファイルを使用して、ConfigurationManagerを用いてライセンスキーの値を取得し、それをIronPrint.License.LicenseKeyプロパティに渡すことができます。
using System.Configuration;
string licenseKey = ConfigurationManager.AppSettings ["IronPrint.LicenseKey"];
IronPrint.License.LicenseKey = licenseKey;
using System.Configuration;
string licenseKey = ConfigurationManager.AppSettings ["IronPrint.LicenseKey"];
IronPrint.License.LicenseKey = licenseKey;
Imports System.Configuration
Private licenseKey As String = ConfigurationManager.AppSettings ("IronPrint.LicenseKey")
IronPrint.License.LicenseKey = licenseKey