IronPrint on macOS with .NET 8 (Apple Silicon)
Running IronPrint in a .NET 8 console app on Apple Silicon macOS can fail at build time with missing native libraries, and Printer.GetPrinterNamesAsync() throws at runtime.
System.PlatformNotSupportedException: System.Drawing.Common is not supported on this platform.
macOS does not ship libgdiplus, the GDI+ implementation that IronPrint and System.Drawing depend on, and a plain net8.0 target never enables the macOS-specific platform APIs. Both gaps have to be closed.
Solution
1. Install the Native GDI+ Library
Install libgdiplus through Homebrew so the GDI+ support that Windows provides by default is available on macOS:
brew install mono-libgdiplus
brew install mono-libgdiplus
Without this library, System.Drawing has no native backend to call into.
2. Target the macOS Framework
Point your .csproj at the macOS-specific target framework instead of plain net8.0:
<TargetFramework>net8.0-macos</TargetFramework>
<TargetFramework>net8.0-macos</TargetFramework>
This tells .NET to use the macOS platform APIs rather than the cross-platform stubs.
net8.0-macos is not part of the default console app templates. Install the macOS workload or start from a macOS app template to get preconfigured support.A complete project file looks like this:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0-macos</TargetFramework>
<Nullable>enable</Nullable>
<UseSystemDrawing>true</UseSystemDrawing>
</PropertyGroup>
</Project>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0-macos</TargetFramework>
<Nullable>enable</Nullable>
<UseSystemDrawing>true</UseSystemDrawing>
</PropertyGroup>
</Project>
3. Use a Compatible Print API
On macOS, call ShowPrintDialogAsync() for print operations rather than relying on Windows-only printing paths.

