Free Support Forum -

Creating Presentations in AWS Lambda environment does not work (libdl missing) (C#.Net Core)

Hi all,

I’m currently trying to create presentation out of a AWS Lambda function. Unfortunately, during the initialization of Aspose.Slides, a Exception is thrown:

One or more errors occurred. (The type initializer for ‘Gdip’ threw an exception.): AggregateException
at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
at lambda_method(Closure , Stream , Stream , LambdaContextInternal )

at System.Drawing.SafeNativeMethods.Gdip.GdipCreateBitmapFromScan0(Int32 width, Int32 height, Int32 stride, Int32 format, HandleRef scan0, IntPtr& bitmap)
at System.Drawing.Bitmap…ctor(Int32 width, Int32 height, PixelFormat format)
at Aspose.Slides.Slide.GetThumbnail(Size imageSize)
at .( , IPresentation )
at .(IPresentation , Stream , PresentationTypeEx , IPptxOptions , InterruptionToken )
at Aspose.Slides.Presentation.Save(Stream stream, SaveFormat format, ISaveOptions options)
at Aspose.Slides.Presentation.Save(String fname, SaveFormat format)
at serverless_pptexporter_processor_csharp.Function.FunctionHandler(String input, ILambdaContext context) in C:\Users\Max\source\repos\ppt\ppt\Function.cs:line 54
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: DllNotFoundException
at Interop.Libdl.dlopen(String fileName, Int32 flag)
at System.Drawing.SafeNativeMethods.Gdip.LoadNativeLibrary()
at System.Drawing.SafeNativeMethods.Gdip…cctor()

It looks like the dependency “Libdl” is missing or can’t be found in this linux environment. I’ve already added the NuGet package “System.Drawing.Common” to my project, but this didn’t help.

Does anybody know how to get this working?

Thank you
Best regards


I have observed the issue shared by you and request you to please provide the sample project and source presentation (if any) that is reproducing the issue on your end. We will be able to investigate the issue further on our end on provision of requested information.

@mudassir.fayyaz, thanks a lot for your help

Attached is the sample VS project. The source code is very simple:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

using Amazon.Lambda.Core;
using Aspose.Slides;
using Aspose.Slides.Export;

// Assembly attribute to enable the Lambda function’s JSON input to be converted into a .NET class.
[assembly: LambdaSerializer(typeof(Amazon.Lambda.Serialization.Json.JsonSerializer))]

namespace AsposeSlides_AWSLambda_CSharp
public class Function

    public string FunctionHandler(string input, ILambdaContext context)

        Presentation presentation = new Presentation();
        ISlide slide = presentation.Slides[0];
        presentation.Save("/tmp/NewPresentation_out.pptx", SaveFormat.Pptx);
        return "Done";


I did not use a source presentation.
Thanks again for your support!


Thank you sharing the information. An issue with ID SLIDESNET-41073 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.

Thanks @mudassir.fayyaz

Please let me know, as soon as you know, if this is a issue that has to be fixed on your end or if it is just a configuration problem. I’d like to order the paid version of Aspose.Slides but this requirements is mandatory for me. If it`s a bug and takes some time, I’m probably have to choose another tool or the Java version of Aspose. However, I’d prefer to use the C# version of Aspose.Slides. Thank you


Sure, we will share good news with you soon.

Hi @Adnan.Ahmad , I just wanted to check if this has been fixed. Thanks


Thank you for sharing the feedback.


I did not give a feedback :slight_smile: I was just asking for the status of this issue.

Thank you


I regret to share that at present the issue is still unresolved. We request for your patience till the time the issue gets resolved.

Hi @mudassir.fayyaz,

I’m also facing the same issue.what is status of the isssue.


I have verified from our issue tracking system and regret to share that at present the issue is unresolved. We request for your patience till the time the issue gets resolved. We will share notification with you as soon as the issue will be fixed.

Facing the same issue, is there any solution for this.


I have observed your comments. Actually, the concerned issue associated with this thread is unresolved. We request for your patience and will share the good news with you as soon as the issue will be fixed.


Actually, Aspose.Slides depends internally on the GDI+ graphics library. Microsoft has released System.Drawing.Common NuGet package to provide cross-platform access for the GDI+ graphics functionality via declaring .NET Standard conformed API (essentially, GDI+ is a built-in library for Windows, but this is not always true for other Linux-based distributions). The System.Drawing.Common package (which referenced in the project), despite its cross-platform nature and the presence of additional .dll libraries in the project, have external dependencies, which are usually absent in Linux. Such dependencies must be installed separately.

Therefore, each AWS Lambda instance is a container created from Amazon Linux AMIs (see reference). Linux distribution related to RHEL, and to be able to use GDI+ functionality in the RHEL environment, the following packages must be installed:

glibc-devel, libgdiplus fnd libX11-devel

For creating AWS Lambda Layers you can reference this link. To create a package with additional native packages, please visit this link.

Please note that using Aspose.Slides in AWS Lambda Function may not be a very good idea, since AWS Lambda has limitations on the resources used. A better solution may be to use AWS Lambda in conjunction with ECS. Please see this web reference link for your convenience as well.

The issues you have found earlier (filed as SLIDESNET-41073) have been fixed in this update. This message was posted using Bugs notification tool.