IronPrint ライセンス設定のトラブルシューティング
この問題は、IronPrint バージョン 2024.3.6 にて解決されました。
# This shell output shows an unhandled exception error due to missing license for IronPrint.
Exception: Unhandled exception. IronSoftware.Exceptions.LicensingException: IronPrint must be licensed for development.
# This shell output shows an unhandled exception error due to missing license for IronPrint.
Exception: Unhandled exception. IronSoftware.Exceptions.LicensingException: IronPrint must be licensed for development.
IronPrintの旧バージョン、具体的にはバージョン2024.3.6より前にリリースされたものについては、以下の点で既知のライセンス上の問題があります:
- ASP.NET プロジェクト
- .NET Framework バージョン 4.6.2 以上
Web.co/nfig ファイルに保存されたキーは、本製品によって取得・使用されることはありません。
回避策
この問題に対処するには、コード内で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;
using System.Co/nfiguration;
namespace IronPrintLicenseSetup
{
class Program
{
static void Main()
{
// Retrieve the license key from the appSettings section of the Web.co/nfig file.
string licenseKey = ConfigurationManager.AppSettings["IronPrint.LicenseKey"];
// Apply the retrieved license key to the IronPrint's LicenseKey property.
IronPrint.License.LicenseKey = licenseKey;
// Notify user that the license key has been applied.
Console.WriteLine("License Key has been applied successfully.");
}
}
}
using System;
using System.Co/nfiguration;
namespace IronPrintLicenseSetup
{
class Program
{
static void Main()
{
// Retrieve the license key from the appSettings section of the Web.co/nfig file.
string licenseKey = ConfigurationManager.AppSettings["IronPrint.LicenseKey"];
// Apply the retrieved license key to the IronPrint's LicenseKey property.
IronPrint.License.LicenseKey = licenseKey;
// Notify user that the license key has been applied.
Console.WriteLine("License Key has been applied successfully.");
}
}
}
Imports System
Imports System.Configuration
Namespace IronPrintLicenseSetup
Class Program
Shared Sub Main()
' Retrieve the license key from the appSettings section of the Web.config file.
Dim licenseKey As String = ConfigurationManager.AppSettings("IronPrint.LicenseKey")
' Apply the retrieved license key to the IronPrint's LicenseKey property.
IronPrint.License.LicenseKey = licenseKey
' Notify user that the license key has been applied.
Console.WriteLine("License Key has been applied successfully.")
End Sub
End Class
End Namespace
上記の例では、ConfigurationManager.AppSettings を使用して、Web.co/nfig からライセンスキーを直接取得しています。 その後、IronPrintコンポーネントのキーをLicenseKeyに設定することで、アプリケーションが正しく動作するために必要なライセンスが確保されます。

