Donald
Donald

Reputation: 633

Why I got Unable to load DLL 'libgdiplus': The specified module could not be found - CentOS 7.5

codes below works properly in local dev machine..(Windows 8.1 x64)

   [HttpGet]
   [AllowAnonymous]
     public ActionResult TestReport(int _pid)
    {
        Reports.XtraReport _xtrareport = new Reports.XtraReport();
        _xtrareport.CreateDocument(true);
        var stream = new MemoryStream();
        _xtrareport.ExportToPdf(stream);
        return  File(stream.GetBuffer(), "application/pdf");
      }

but it thrown exceptions below when I try on CentOS 7.5

, it thrown exceptions below:

An unhandled exception occurred while processing the request.DllNotFoundException: Unable to load DLL 'libgdiplus': The specified module could not be found. System.Runtime.InteropServices.FunctionWrapper.get_Delegate()

TypeInitializationException: The type initializer for 'Gdip' threw an exception. System.Drawing.SafeNativeMethods+Gdip.GdipGetGenericFontFamilySansSerif(out IntPtr fontfamily)

TypeInitializationException: The type initializer for 'DevExpress.XtraPrinting.BrickStyle' threw an exception. DevExpress.XtraReports.UI.XRControlStyle..ctor()

Stack Query Cookies Headers DllNotFoundException: Unable to load DLL 'libgdiplus': The specified module could not be found.System.Runtime.InteropServices.FunctionWrapper.get_Delegate() System.Drawing.SafeNativeMethods+Gdip.GdiplusStartup(out IntPtr token, ref StartupInput input, out StartupOutput output) System.Drawing.SafeNativeMethods+Gdip..cctor()

Show raw exception details

TypeInitializationException: The type initializer for 'Gdip' threw an exception.System.Drawing.SafeNativeMethods+Gdip.GdipGetGenericFontFamilySansSerif(out IntPtr fontfamily) System.Drawing.FontFamily.GetGdipGenericSansSerif() System.Drawing.FontFamily.get_GenericSansSerif() System.Drawing.Font.CreateFont(string familyName, float emSize, FontStyle style, GraphicsUnit unit, byte charSet, bool isVertical) DevExpress.XtraPrinting.BrickStyle..cctor()

Upvotes: 1

Views: 2608

Answers (1)

Donald
Donald

Reputation: 633

I have resolved this problem with the following steps:

    sudo yum install yum-utils
    sudo rpm rpm --import    "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"
    sudo yum-config-manager --add-repo http://download.mono-  project.com/repo/centos/
    sudo yum clean all
    sudo yum makecache
    sudo yum install mono-complete

Upvotes: 0

Related Questions