ASP.NET 構成における IronWord ライセンス キー
Curtis Chau
更新日: 2025年6月10日
問題はIronWordバージョン2024.3.5で解決済みです。
Exception: Unhandled exception. IronSoftware.Exceptions.LicensingException: IronWord must be licensed for development.
Text
以前のバージョンのIronWord、特にバージョン2024.3.5より前にリリースされたものには、以下のようなライセンス問題が知られています:
- ASP.NETプロジェクト
- .NET Frameworkバージョン >= 4.6.2
キーがWeb.configファイルに保存されても、製品によって使用されません。
回避策
この問題に対処するためには、コード内でConfigurationManagerを使用してWeb.configファイルからライセンスキーを取得し、License.LicenseKeyプロパティに適用することをお勧めします。
例:
<configuration>
...
<appSettings>
<add key="IronWord.LicenseKey" value="IRONWORD.MYLICENSE.KEY.1EF01"/>
</appSettings>
...
</configuration>
XML
上記のXMLファイルを使用して、ConfigurationManagerでライセンスキーの値を取得し、それをIronWord.License.LicenseKeyプロパティに渡します。
// Import the necessary namespace for ConfigurationManager
using System.Configuration;
// Retrieve the license key from the AppSettings in Web.config
string licenseKey = ConfigurationManager.AppSettings["IronWord.LicenseKey"];
// Set the license key for IronWord
IronWord.License.LicenseKey = licenseKey;' Import the necessary namespace for ConfigurationManager
Imports System.Configuration
' Retrieve the license key from the AppSettings in Web.config
Private licenseKey As String = ConfigurationManager.AppSettings("IronWord.LicenseKey")
' Set the license key for IronWord
IronWord.License.LicenseKey = licenseKey' Import the necessary namespace for ConfigurationManager
Imports System.Configuration
' Retrieve the license key from the AppSettings in Web.config
Private licenseKey As String = ConfigurationManager.AppSettings("IronWord.LicenseKey")
' Set the license key for IronWord
IronWord.License.LicenseKey = licenseKeyテクニカルライター
Curtis Chauは、カールトン大学でコンピュータサイエンスの学士号を取得し、Node.js、TypeScript、JavaScript、およびReactに精通したフロントエンド開発を専門としています。直感的で美しいユーザーインターフェースを作成することに情熱を持ち、Curtisは現代のフレームワークを用いた開発や、構造の良い視覚的に魅力的なマニュアルの作成を楽しんでいます。