Using IronXL License Keys

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

How to Get a License Key

Adding an IronXL license key allows you to deploy your project live without restrictions or watermarks.

You can buy a license key or sign up for a free 30-day trial key here.


Step 1: Download the Latest Version of IronXL

今天在您的项目中使用 IronXL,免费试用。

第一步:
green arrow pointer


The first thing we need to do is install the IronXL.Excel library, adding Excel functionality to the .NET framework.

Install with NuGet Package

  1. In Visual Studio, right-click on the project and select "Manage NuGet Packages ..."
  2. Search for the IronXL.Excel package and install

Or

  1. Enter the Package Manager Console
  2. Type:

    Install-Package IronXL.Excel

View the package on the NuGet site here.

DLL Direct Download Installation

Download the IronXL [.NET Excel DLL]() and manually install it into Visual Studio.


Step 2: Apply Your License Key

Set the license key inside your code

Add this code to the startup of your application, before IronXL is used.

// Set the IronXL license key for your project
IronXL.License.LicenseKey = "IRONXL-MYLICENSE-KEY-1EF01";
// Set the IronXL license key for your project
IronXL.License.LicenseKey = "IRONXL-MYLICENSE-KEY-1EF01";
' Set the IronXL license key for your project
IronXL.License.LicenseKey = "IRONXL-MYLICENSE-KEY-1EF01"
$vbLabelText   $csharpLabel

Set your key using Web.Config or App.Config in .NET Framework Applications

To apply a key globally to your application using Web.Config or App.Config, add the following key to your config file in appSettings.

<configuration>
  ...
  <appSettings>
    <!-- Define the IronXL license key -->
    <add key="IronXL.LicenseKey" value="IRONXL-MYLICENSE-KEY-1EF01"/>
  </appSettings>
  ...
</configuration>
<configuration>
  ...
  <appSettings>
    <!-- Define the IronXL license key -->
    <add key="IronXL.LicenseKey" value="IRONXL-MYLICENSE-KEY-1EF01"/>
  </appSettings>
  ...
</configuration>
XML

There is a known licensing issue between IronXL version 2023.4.13 - 2024.3.20 on project:

  • ASP.NET projects
  • .NET Framework version >= 4.6.2

The key stored in a Web.config file is NOT being picked up and used by the product. Visit the 'Setting License Key in Web.config' troubleshooting article to learn more.

Ensure that IronXL.License.IsLicensed returns true to verify.


Set your key using a .NET Core appsettings.json file

To apply a key globally to your .NET Core application:

  • Add a JSON file to your project called appsettings.json in the root directory of your project
  • Add a 'IronXL.LicenseKey' key to your JSON config file. The value should be your license key.
  • Ensure that the file properties include Copy to Output Directory: Copy always
  • Ensure that IronXL.License.IsLicensed returns true to verify.

File: appsettings.json

{
  "IronXL.LicenseKey": "IRONXL-MYLICENSE-KEY-1EF01"
}

Step 3: Test your key

Test if your key has been installed correctly.

// Check if a given license key string is valid.
bool result = IronXL.License.IsValidLicense("IRONXL-MYLICENSE-KEY-1EF01");

// Check if IronXL is licensed successfully
bool is_licensed = IronXL.License.IsLicensed;
// Check if a given license key string is valid.
bool result = IronXL.License.IsValidLicense("IRONXL-MYLICENSE-KEY-1EF01");

// Check if IronXL is licensed successfully
bool is_licensed = IronXL.License.IsLicensed;
' Check if a given license key string is valid.
Dim result As Boolean = IronXL.License.IsValidLicense("IRONXL-MYLICENSE-KEY-1EF01")

' Check if IronXL is licensed successfully
Dim is_licensed As Boolean = IronXL.License.IsLicensed
$vbLabelText   $csharpLabel

Note: After adding a license, always remember to clean and republish your application to avoid potential mistakes in deployment.


Step 4: Get started with your project

Follow our tutorial on how to Get Started with IronXL.


Questions?

If you have any questions, reach out to support@ironsoftware.com

常见问题解答

我如何为我的项目获取许可证密钥?

您可以通过从IronXL网站购买或者注册一个免费的30天试用版来获取许可证密钥。

使用NuGet包管理器安装IronXL的步骤是什么?

要使用NuGet包管理器安装IronXL,打开Visual Studio,右击您的项目,选择“管理NuGet包...”,搜索IronXL.Excel并安装。或者,您可以在包管理器控制台中输入Install-Package IronXL.Excel

如何手动使用DLL安装IronXL?

您可以通过从IronXL的网站下载.NET Excel DLL并将其添加到您的Visual Studio项目中来手动安装IronXL。

我如何在应用程序代码中应用我的许可证密钥?

使用以下代码在应用程序的启动代码中添加许可证密钥:IronXL.License.LicenseKey = "YOUR-LICENSE-KEY"

如何在.NET Framework应用程序的Web.Config文件中设置我的许可证密钥?

您可以通过在appSettings部分添加以下内容来在Web.Config文件中设置您的许可证密钥:<add key="IronXL.LicenseKey" value="YOUR-LICENSE-KEY"/>

某些版本的IronXL有已知的许可问题吗?

是的,在ASP.NET项目和.NET Framework版本4.6.2及以上中,IronXL版本2023.4.13 - 2024.3.20存在一个已知问题,Web.config中存储的密钥可能无法识别。

如何在.NET Core应用程序中使用appsettings.json应用我的许可证密钥?

在您的.NET Core应用程序中,添加一个名为appsettings.json的JSON文件,包含一个'IronXL.LicenseKey'条目和您的许可证密钥,并将文件属性设置为'Copy to Output Directory: Copy always'。

如何验证我的IronXL许可证密钥是否正确应用?

要验证您的许可证密钥,使用IronXL.License.IsValidLicense("YOUR-LICENSE-KEY")检查其有效性,并确保IronXL.License.IsLicensed返回true。

在添加许可证密钥后应采取哪些步骤?

添加许可证密钥后,重要的是清理并重新发布您的应用程序以避免部署问题。

我在哪里可以找到更多的帮助或支持?

如需更多帮助或支持,您可以联系Iron Software支持团队,邮箱是support@ironsoftware.com。

IronXL 的许可是否完全支持 .NET 10 项目和平台?

是的。IronXL 的产品,包括通过代码、Web.Config 或 appsettings.json 进行许可的方式,在 .NET 10(以及 .NET 9、8、7、6 和 .NET Core/Standard/Framework 版本)上完全受支持,无需特殊配置。要在 .NET 10 中应用许可证密钥,请使用官方文档中所示的相同方法:在启动代码中设置IronXL.License.LicenseKey ,或使用类似 appsettings.json 的配置文件,并在其中设置"IronXL.LicenseKey": "YOUR-KEY" ,并确保将该文件复制到输出目录。这符合 IronXL 的兼容性声明。([ironsoftware.com](https://ironsoftware.com/csharp/excel/?utm_source=openai))

Curtis Chau
技术作家

Curtis Chau 拥有卡尔顿大学的计算机科学学士学位,专注于前端开发,精通 Node.js、TypeScript、JavaScript 和 React。他热衷于打造直观且美观的用户界面,喜欢使用现代框架并创建结构良好、视觉吸引力强的手册。

除了开发之外,Curtis 对物联网 (IoT) 有浓厚的兴趣,探索将硬件和软件集成的新方法。在空闲时间,他喜欢玩游戏和构建 Discord 机器人,将他对技术的热爱与创造力相结合。

准备开始了吗?
Nuget 下载 1,686,155 | 版本: 2025.11 刚刚发布