IronWord Lisans Anahtarı ASP.NET Yapılandırması

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

Sorun, IronWord 2024.3.5 sürümü itibariyle çözüldü.

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

Özellikle 2024.3.5 sürümünden önce yayınlanan eski IronWord sürümleri için bilinen bir lisanslama sorunu bulunmaktadır:

  • ASP.NET projeleri
  • .NET Framework sürümü >= 4.6.2

Ürün, Web.config dosyasında saklanan anahtarı KULLANMAYACAK.

Geçici Çözüm

Bu sorunu çözmek için, kodda ConfigurationManager kullanarak lisans anahtarını Web.config dosyasından almak ve ardından License.LicenseKey özelliğine uygulamak önerilmektedir.

Örnek:

<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

Yukarıda sağlanan XML dosyasıyla, lisans anahtarı değerini almak ve IronWord.License.LicenseKey özelliğine aktarmak için ConfigurationManager kullanabiliriz.

// 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
Teknik Yazar

Curtis Chau, Bilgisayar Bilimleri alanında lisans derecesine sahiptir (Carleton Üniversitesi) ve Node.js, TypeScript, JavaScript ve React konularında uzmanlaşmış ön uç geliştirme üzerine uzmanlaşmıştır. Kullanıcı dostu ve estetik açıdan hoş arayüzler tasarlamaya tutkuyla bağlı olan Curtis, modern çerç...

Daha Fazlasını Oku
Başlamaya Hazır mısınız?
Nuget İndirmeler 39,467 | Sürüm: 2026.4 just released
Still Scrolling Icon

Hala Kaydiriyor musunuz?

Hızlı bir kanit mi istiyorsunuz? PM > Install-Package IronWord
bir örnek çalıştır verilerinizin bir Word belgesine dönüştüğünü izleyin.