Getting Started with IronWord on macOS

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

IronWord allows .NET developers to read, create, and manipulate Word documents in C# without requiring Microsoft Office installed. While it’s typically used in Windows and Linux environments, IronWord also runs well on macOS with the right setup.

This guide walks you through installing dependencies and getting IronWord working in your macOS development environment.

Prerequisites for macOS

Before getting started with IronWord on macOS, make sure you have the following installed:

IronWord works best with .NET Core LTS versions or later .NET SDKs.

Install Native macOS Dependencies

IronWord depends on libgdiplus for graphical operations, such as rendering and processing DOCX content.

You can install this dependency using Homebrew:

brew install mono-libgdiplus

This installs the required native image rendering library. If you get errors related to System.Drawing.Common, this is usually the missing dependency.

NuGet Package Installation

IronWord works on both Apple Silicon and Intel Macs. We recommend the standard IronWord package for most users.

Install-Package IronWord

Compatibility with macOS ARM

IronWord is fully compatible with Apple Silicon chips. Developers using M1 or M2 machines can use the same IronWord NuGet package and setup instructions.

If you're using Visual Studio for Mac or JetBrains Rider, ensure you're targeting .NET 6 or higher for best compatibility.

常见问题解答

使用IronWord在macOS上的先决条件是什么?

要在macOS上使用IronWord,确保您已安装.NET 6或.NET 7 SDK、Homebrew,并且是macOS 11(Big Sur)或更高版本。IronWord兼容Apple Silicon和Intel Mac。

如何在macOS上安装IronWord所需的依赖项?

您可以使用Homebrew并通过命令'brow install mono-libgdiplus'来安装所需的本地依赖libgdiplus。这有助于图形操作,如呈现和处理DOCX内容。

IronWord兼容Apple Silicon芯片吗?

是的,IronWord完全兼容Apple Silicon芯片,例如M1和M2机器中的芯片。您可以使用相同的IronWord NuGet包和设置说明,适用于Intel Mac。

如果遇到与System.Drawing.Common相关的错误,我该怎么办?

此类错误通常表示缺少依赖项。确保您已使用Homebrew安装了libgdiplus,因为它是IronWord图形操作所需的。

推荐哪种开发环境用于macOS上的IronWord?

IronWord可以搭配Visual Studio for Mac和JetBrains Rider使用。为了最佳兼容性,确保您以.NET 6或更高版本为目标。

使用IronWord需要安装Microsoft Office吗?

不,IronWord允许您在C#中读取、创建和操作Word文档,无需在系统上安装Microsoft Office。

IronWord可以在macOS以外的环境中使用吗?

是的,虽然此指南侧重于macOS,但IronWord还设计用于在Windows和Linux环境中运行。

应该为macOS安装哪个NuGet包用于IronWord?

对于大多数用户,我们推荐安装标准的IronWord NuGet包,该包支持Apple Silicon和Intel Mac。

IronWord在macOS上支持哪些版本的.NET?

IronWord最佳工作于.NET Core LTS版本或更高版本的.NET SDK,以确保最佳性能和兼容性。

Kye Stuart
技术作家

Kye Stuart 在 Iron Software 中将编码热情与写作技能结合在一起。他在 Yoobee 学院接受软件部署教育,现在将复杂的技术概念转化为清晰的教育内容。Kye 重视终身学习,接受新的技术挑战。

工作之余,他们喜欢 PC 游戏、Twitch 上的直播,以及户外活动如园艺和带狗 Jaiya 散步。Kye 的直截了当的方法使他们成为 Iron Software 使命的关键,即为全球开发者解密技术。

准备开始了吗?
Nuget 下载 25,807 | 版本: 2025.11 刚刚发布