ASP.NET 構成における IronWord ライセンス キー

This article was translated from English: Does it need improvement?
Translated
View the article in English

この問題は、IronWord バージョン2024.3.5解決されました。

Exception: Unhandled exception. IronSoftware.Exceptions.LicensingException: IronWord must be licensed for development.

バージョン2024.3.5より前にリリースされた古いIronWordバージョンについては、以下のライセンス問題が存在します:

  • ASP.NETプロジェクト
  • .NET Frameworkバージョン >= 4.6.2

Web.configファイルに保存されたキーが製品によって使用されません

回避策

この問題を解決するには、コード内でConfigurationManagerを使用してWeb.configファイルからライセンスキーを取得し、それをLicense.LicenseKeyプロパティに適用することをお勧めします。

Example:

<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

上記の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
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
$vbLabelText   $csharpLabel
カーティス・チャウ
テクニカルライター

Curtis Chauは、カールトン大学でコンピュータサイエンスの学士号を取得し、Node.js、TypeScript、JavaScript、およびReactに精通したフロントエンド開発を専門としています。直感的で美しいユーザーインターフェースを作成することに情熱を持ち、Curtisは現代のフレームワークを用いた開発や、構造の良い視覚的に魅力的なマニュアルの作成を楽しんでいます。

開発以外にも、CurtisはIoT(Internet of Things)への強い関心を持ち、ハードウェアとソフトウェアの統合方法を模索しています。余暇には、ゲームをしたりDiscordボットを作成したりして、技術に対する愛情と創造性を組み合わせています。

準備はできましたか?
Nuget ダウンロード 27,129 | Version: 2025.11 リリース