Resolving libcef.dll Errors in IronPDF
Are you seeing the following error messages?
- Error loading one of the Chrome assemblies (libcef.dll)
- Chrome Deployment Failure (error while loading libcef.dll) (203)
This is because System.Drawing
is not included in Windows Nano Server, and Windows Server Core (.NET6).
The official .NET images for Windows are based on Nano Server.
To work around this issue, we suggest either:
- Build & deploy your project as
self-contained
. Click here for more information on this option. - Switch to Linux-based container images by changing the following property in your
.csproj
file:
<!-- Change the default OS for Docker to Linux to use Linux-based images -->
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<!-- Change the default OS for Docker to Linux to use Linux-based images -->
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
You can then add Linux dependencies with the following shell commands:
# Update package lists and install necessary libraries for IronPDF on Linux
RUN apt update \
&& apt install -y libgdiplus libxkbcommon-x11-0 libc6 libc6-dev libgtk2.0-0 libnss3 \
libatk-bridge2.0-0 libx11-xcb1 libxcb-dri3-0 libdrm-common libgbm1 libasound2 \
libxrender1 libfontconfig1 libxshmfence1
# Update package lists and install necessary libraries for IronPDF on Linux
RUN apt update \
&& apt install -y libgdiplus libxkbcommon-x11-0 libc6 libc6-dev libgtk2.0-0 libnss3 \
libatk-bridge2.0-0 libx11-xcb1 libxcb-dri3-0 libdrm-common libgbm1 libasound2 \
libxrender1 libfontconfig1 libxshmfence1
(The above dependencies are for Debian 11, though specific dependencies for Ubuntu, CentOS, Amazon Linux, and more can be viewed here)