Solucionar Fallos de Conexión de Docker de IronPdfEngine en macOS ARM
Al conectar una aplicación .NET a IronPdfEngine vía Docker en un dispositivo ARM de macOS (Apple Silicon), la aplicación lanza:
Unhandled exception. System.IO.FileNotFoundException: Error loading native library.
Not found in any of the possible locations
IronPdfConnectionType.Docker utiliza una implementación gRPC más antigua que no soporta arquitectura ARM. En macOS ARM (Apple Silicon), el cliente .NET no puede cargar el binario nativo requerido de gRPC, incluso cuando se fuerza a la imagen de Docker a ejecutar como --platform linux/amd64. Las plataformas Windows y Linux x64 no se ven afectadas.
Solución
Reemplaza IronPdfConnectionType.Docker con IronPdfConnectionType.RemoteServer en la configuración de conexión. RemoteServer utiliza una implementación gRPC más nueva que es compatible con ARM:
using IronPdf;
var config = new IronPdfConnectionConfiguration
{
ConnectionType = IronPdfConnectionType.RemoteServer,
Host = "http://127.0.0.1",
Port = 33350
};
IronPdf.Installation.ConnectToIronPdfHost(config);
IronPdf.License.LicenseKey = Environment.GetEnvironmentVariable("IRONPDF_LICENSE_KEY");
var renderer = new ChromePdfRenderer();
var pdf = await renderer.RenderHtmlAsPdfAsync("<h1>Hello from IronPdfEngine</h1>");
pdf.SaveAs("output.pdf");
using IronPdf;
var config = new IronPdfConnectionConfiguration
{
ConnectionType = IronPdfConnectionType.RemoteServer,
Host = "http://127.0.0.1",
Port = 33350
};
IronPdf.Installation.ConnectToIronPdfHost(config);
IronPdf.License.LicenseKey = Environment.GetEnvironmentVariable("IRONPDF_LICENSE_KEY");
var renderer = new ChromePdfRenderer();
var pdf = await renderer.RenderHtmlAsPdfAsync("<h1>Hello from IronPdfEngine</h1>");
pdf.SaveAs("output.pdf");
Imports IronPdf
Dim config As New IronPdfConnectionConfiguration With {
.ConnectionType = IronPdfConnectionType.RemoteServer,
.Host = "http://127.0.0.1",
.Port = 33350
}
IronPdf.Installation.ConnectToIronPdfHost(config)
IronPdf.License.LicenseKey = Environment.GetEnvironmentVariable("IRONPDF_LICENSE_KEY")
Dim renderer As New ChromePdfRenderer()
Dim pdf = Await renderer.RenderHtmlAsPdfAsync("<h1>Hello from IronPdfEngine</h1>")
pdf.SaveAs("output.pdf")
Requirements:
- El contenedor Docker de IronPdfEngine debe estar en funcionamiento y accesible en el host y puerto especificados antes de llamar a
ConnectToIronPdfHost. - Use
http://, nohttps://; usarhttps://sin un certificado SSL válido causa errores de corrupción de tramas en el canal gRPC.
Consulta también: solución de problemas de inicialización Vulkan/ANGLE en Docker y solución de errores de conexión gRPC en Azure Containers.

