IRONSOFTWAREHOME

IronWord with DocumentFormat.OpenXml

Curtis Chau
Curtis Chau
Updated: July 21, 2026
Please note: This conflict was fixed in IronWord 2025.7.13 — over a year before the current release. If your project is already on a recent IronWord version, you are unlikely to encounter this issue; the guidance below remains for teams still on an older build or who see similar symptoms after upgrading.

IronWord versions prior to 2025.7.13 could produce corrupted documents, incorrect formatting, or runtime errors when run alongside DocumentFormat.OpenXml in the same project. This dependency-version conflict was fixed in IronWord 2025.7.13. The guidance below applies if your project is on an older build, or if you still encounter conflicts after upgrading.

System.InvalidOperationException
NullReferenceException
Text

The trouble comes from internal type and dependency mismatches between IronWord and newer releases of DocumentFormat.OpenXml. When those versions disagree, you see document corruption, broken formatting, or exceptions thrown at runtime.

Solution

Option 1: Pin DocumentFormat.OpenXml to 2.8.1

If your project genuinely needs both packages, lock DocumentFormat.OpenXml to version 2.8.1, which has been tested to coexist with IronWord without stability or output problems.

Install-Package DocumentFormat.OpenXml -Version 2.8.1
SHELL
Warning: On IronWord builds prior to 2025.7.13, using a newer version of DocumentFormat.OpenXml may reproduce this conflict.

Option 2: Drop DocumentFormat.OpenXml

When the package is not essential to your workflow, remove it and rely on IronWord alone. Using IronWord on its own avoids the conflict entirely and keeps output reliable.

Curtis Chau
Technical Writer

Curtis Chau holds a Bachelor’s degree in Computer Science (Carleton University) and specializes in front-end development with expertise in Node.js, TypeScript, JavaScript, and React. Passionate about crafting intuitive and aesthetically pleasing user interfaces, Curtis enjoys working with modern frameworks and creating well-structured, visually appealing manuals.

...
Read More

Ready to Get Started?

Nuget Downloads 56,401Version:2026.9just released

Get your free 30-day Trial Key instantly.
No credit card or account creation required
C# NuGet Library for PDF
Install with NuGet

Version: 2026.9

PM > Install-Package IronWord
nuget.org/packages/IronWord/
  1. In Solution Explorer, right-click References, Manage NuGet Packages
  2. Select Browse and search "IronWord"
  3. Select the package and install
C# PDF DLL
Download DLL

Version: 2026.9

  1. Download and unzip IronWord to a location such as ~/Libs within your Solution directory
  2. In Visual Studio Solution Explorer, right click References. Select Browse, "IronWord.dll"

Licenses from $999

Key in blue circle

Get your free 30-day Trial Key instantly.

Your trial license will be sent to your email address

No limitations. 100% unlocked. No credit card.

bullet_checkedNo credit card or account creation requiredNo limitations. 100% unlocked. No credit card.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
Book your free Live Demo
Booking Badge

Trusted by Millions of Engineers Worldwide

Iron Software's customer logos
Get Your No-Obligation Consult
Complete the form below or email sales@ironsoftware.com
Your details will always be kept confidential.
Trusted by Millions of Engineers Worldwide
Iron Software's customer logos
Get your free 30-day Trial Key instantly.
No credit card or account creation required