IronPrint License Configuration Troubleshooting

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

Das Problem wurde gelöst in IronPrint Version 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.
SHELL

Für ältere IronPrint-Versionen, insbesondere die vor der Version 2024.3.6, besteht ein bekanntes Lizenzproblem in:

  • ASP.NET-Projekten
  • .NET Framework Version >= 4.6.2

Der im Web.config-Datei gespeicherte Schlüssel wird vom Produkt NICHT erkannt und verwendet.

Problemumgehung

Um dieses Problem zu lösen, wird empfohlen, den Lizenzschlüssel aus der Web.config-Datei mit ConfigurationManager im Code abzurufen und dann auf die License.LicenseKey-Eigenschaft anzuwenden.

Beispiel:

<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

Mit der oben bereitgestellten XML-Datei können wir ConfigurationManager verwenden, um den Lizenzschlüsselwert abzurufen und ihn an die Eigenschaft IronPrint.License.LicenseKey zu übergeben.

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
$vbLabelText   $csharpLabel

Im obigen Beispiel wird ConfigurationManager.AppSettings verwendet, um den Lizenzschlüssel direkt aus der Web.config abzurufen. Der Schlüssel wird dann als LicenseKey für die IronPrint-Komponente gesetzt, um sicherzustellen, dass die Anwendung über die notwendige Lizenz verfügt, um korrekt zu funktionieren.

Curtis Chau
Technischer Autor

Curtis Chau hat einen Bachelor-Abschluss in Informatik von der Carleton University und ist spezialisiert auf Frontend-Entwicklung mit Expertise in Node.js, TypeScript, JavaScript und React. Leidenschaftlich widmet er sich der Erstellung intuitiver und ästhetisch ansprechender Benutzerschnittstellen und arbeitet gerne mit modernen Frameworks sowie der Erstellung gut strukturierter, optisch ansprechender ...

Weiterlesen
Bereit anzufangen?
Nuget Downloads 34,016 | Version: 2025.11 gerade veröffentlicht