Switch to the modern License.LicenseKey = "..." method. If you must use a license file, ensure the file path is correct. Part 7: Best Practices for Managing IronPDF License Keys Do Not Hardcode Keys in Source Control Never commit your license key to public repositories (GitHub, GitLab). Use secrets managers or environment variables . Rotate Keys Periodically If a developer leaves your team, you can invalidate their key from the Iron Software account portal and generate a new one. Separate Development and Production Keys You can generate multiple license keys under one account. Use a trial key for local development and your paid key for staging/production. This prevents accidental leakage of your production key. Automate Validation in CI/CD Pipelines In GitHub Actions or Azure DevOps, store your license key as a secret and inject it at runtime:
string key = config["IronPdf:LicenseKey"]; IronPdf.License.LicenseKey = key; ironpdf license key
Purchase additional developer seats. Or ensure only one developer's machine runs the code during build. Error 5: "Could not load IronPDF license from embedded resource" Cause: Some legacy code uses IronPdf.License.LoadLicenseFromFile or embedded .dll resources. Switch to the modern License
Ensure the license key assignment is the first line of your Main() or Startup method. If using ASP.NET, place it in Program.cs before builder.Build() . Error 2: "Your trial has expired" Cause: Your 30-day trial key has passed its expiration date. Use secrets managers or environment variables
{ "IronPdf": { "LicenseKey": "IRONPDF.MYCOMPANY.2023.ABCD1234EFGH" } }
if (!IronPdf.License.IsValidLicense()) { logger.LogError("IronPDF license is invalid or missing. PDF generation will fail."); // Optionally, shut down the application. } Q1: Can I use the same IronPDF license key on multiple servers? Yes. Single Developer and Organization licenses allow unlimited production servers. The limitation is on the number of developers writing code against IronPDF. Q2: Does IronPDF require an internet connection to validate the license? No. IronPDF performs offline validation using a cryptographic signature embedded in the key. No call to a licensing server is made. This is designed for air-gapped environments. Q3: What happens if my license expires while my app is in production? Your app will continue to work without interruption . IronPDF never suddenly blocks PDF generation. However, you will see a warning in logs, and you will be unable to download updates or receive support. Q4: How do I remove the trial watermark? You cannot "remove" it—you must replace the trial key with a valid paid license. The watermark is a hard-coded check. Q5: Is there a free open-source alternative? Yes, projects like iTextSharp (AGPL) and QuestPDF exist, but they have restrictive licenses or fewer features. IronPDF is commercial software. Part 9: Step-by-Step Example – Full Implementation Let's walk through a complete .NET 8 Console App that securely uses an IronPDF license key. Step 1: Create a new project dotnet new console -n IronPdfDemo cd IronPdfDemo dotnet add package IronPdf.Licensing dotnet add package Microsoft.Extensions.Configuration dotnet add package Microsoft.Extensions.Configuration.Json Step 2: Add appsettings.json (do not commit to public repos) { "IronPdf": { "LicenseKey": "YOUR-KEY-HERE" } } Step 3: Modify Program.cs using System; using System.IO; using IronPdf; using Microsoft.Extensions.Configuration; class Program { static void Main() { // Load configuration var config = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile("appsettings.json", optional: false) .Build();