-
Notifications
You must be signed in to change notification settings - Fork 824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ClosedXML doesn't work within AWS Lambda Serverless App #1283
Comments
A little more color on this issue: As can be seen in the stacktrace above, the exception above is being caused by the call to Removing that call, however, produces a corrupt file. Example of a corrupt file generated by ClosedXML: items.xlsx
|
It is a known issue (see #1020, #1107, #1121, #1251, #1257). As for the file being corrupted, it seems very strange as the file you attached is not even considered a valid zip archive: |
Thank you @Pankraty. Is there any desire to remove the dependency on Alternatively, is there any desire to isolate these calls somehow, and have a switch to turn these calls off - limiting the features available but at least having basic features working without throwing exceptions? |
Thanks. I'll investigate further. It could be something else on AWS corrupting the file - i.e. not related to ClosedXML. I tried ClosedXML.Extensions.WebApi and it didn't work as per described in ClosedXML.Extensions.WebApi/#1, but I don't believe it's meant to work with ASP .NET Core Web API anyway. |
Issue with Drawing on lambda can be fixed by adding two refs into net core project |
Thanks @Lonli-Lokli I assume you mean adding those dependencies in to the ClosedXML assembly rather than on my on project, right? Just for the sake of it, I did test adding those to my own project, and it didn't make any difference... I still got the same errors in AWS. |
@Pankraty: Just to circle back on the corrupted file issue. As suspected, it is not related to ClosedXML. AWS's API Gateway was corrupting the file by not treating it as binary. For the benefit of people in the future that may find this issue via search, the fix was to set binary media types in AWS's API Gateway for the file types I'm using:
|
@caioproiete Actually I mean to your project. Is it .net core 2.x? Issue with missed libgdi on Linux can be resolved with this usecase - it allows to search for missed libraries in application folder, not only in the system. |
The issue surfaces even when the user does not manually call AdjustToContents. I am working on an Azure Functions project as well, and part of the project involves saving some data as an Excel file to later send in an email. The code was written based on this example: The following line causes Visual Studio to throw an exception: Here is the exception message: Is there a recommended solution for this issue? Edit: Adding the dataTable throws an exception; however, adding a new worksheet and directly editing its cells works. I have gone with the latter implementation for my project, but this is still an issue for anyone who attempts to add a dataTable directly- and is definitely an issue where adjusting cells to content is desired. |
@Zev-Engineer
Hope this helps! |
If I understood correctly, .NET 7 will completely remove cross-platform support for
The source has some recommended alternatives: |
Version of ClosedXML
0.94.2
What is the current behavior?
ASP .NET Core Web API hosted on AWS Lambda using ClosedXML to create an Excel file fails with an exception:
System.DllNotFoundException: Unable to load shared library 'libdl' or one of its dependencies
Exception stack trace:
What is the expected behavior or new feature?
It should... Just Work™ 😃
Did this work in previous versions of our tool? Which versions?
Don't know / probably not.
Reproducibility
The text was updated successfully, but these errors were encountered: