Skip to content

Support libdl on AWS Lambda with .NET Core #516

@augustoproiete

Description

@augustoproiete

I have an ASP .NET Core Web API that uses an OSS library to generate files, and this library makes use of System.Drawing.

It runs fine locally, but, but when deployed to an AWS Serverless app, produces the error below:

System.DllNotFoundException: Unable to load shared library 'libdl' or one of its dependencies

System.TypeInitializationException: The type initializer for 'Gdip' threw an exception. ---> System.DllNotFoundException: Unable to load shared library 'libdl' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibdl: cannot open shared object file: No such file or directory
   at IntPtr Interop+Libdl.dlopen(string fileName, int flag)
   at IntPtr System.Drawing.SafeNativeMethods+Gdip.LoadNativeLibrary()
   at static System.Drawing.SafeNativeMethods+Gdip()
   --- End of inner exception stack trace ---
   at int System.Drawing.SafeNativeMethods+Gdip.GdipGetGenericFontFamilySansSerif(out IntPtr fontfamily)
   at IntPtr System.Drawing.FontFamily.GetGdipGenericSansSerif()
   at FontFamily System.Drawing.FontFamily.get_GenericSansSerif()
   at void System.Drawing.Font.CreateFont(string familyName, float emSize, FontStyle style, GraphicsUnit unit, byte charSet, bool isVertical)

Metadata

Metadata

Assignees

No one assigned

    Labels

    dependenciesThis issue is a problem in a dependency.guidanceQuestion that needs advice or information.module/custom-runtimethird-partyThis issue is related to third-party libraries or applications.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions