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.config ファイルに保存されたキーは、製品によって取得および使用されません。
回避策
この問題に対処するには、コード内でConfigurationManagerを使用して Web.config ファイルからライセンス キーを取得し、それを 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.Configuration;
namespace IronPrintLicenseSetup
{
class Program
{
static void Main()
{
// Retrieve the license key from the appSettings section of the Web.config 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.Configuration;
namespace IronPrintLicenseSetup
{
class Program
{
static void Main()
{
// Retrieve the license key from the appSettings section of the Web.config 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
Friend 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.config からライセンス キーを直接取得しています。 次に、キーはIronPrintコンポーネントの LicenseKey として設定され、アプリケーションが正しく実行するために必要なライセンスがあることが保証されます。

