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

