简体   繁体   中英

.NET Binaries Missing AWS Lambda

I have uploaded a .NET6 project as a zip to AWS Lambda, via Visual Studio --> Publish to AWS Lambda however when I test the lambda, I receive this error:

Error: .NET binaries for Lambda function are not correctly installed in the /var/task directory of the image when the image was built. The /var/task directory is missing.

Does anyone have any suggestions for why this may be happening? Isn't AWS Lambda responsible for including the binaries when you publish as a zip?

Thanks

do you somehow have the project marked as self-contained on the msbuild parameters? maybe in aws-lambda-tools-defaults.json or custom runtime set in serverless.tempate? It seems it is looking for the dotnet runtime assemblies in your application path

Try checking the lambda configuration in the AWS console.

First, check whether there are any clues in the Code ribbons. If you published through VS, there should be some info like The deployment package of your Lambda function is too large to enable inline code editing and Package size XX.Y MB . If there is nothing (which I think will be the case), check your publish setup. The lambda runtime container expects code to be present at /var/task . If you upload code as zip, it should end up in this directory during lambda container initialization.

This error message might also indicate that a wrong runtime is used (eg. missing the dotnet runtime inside the Amazon Linux container). The structure of the dotnet runtime image can be examined through a Dockerfile that the image originates from.

Hope this helps a little.

In my case, I use Upload from -.zip features of Lambda.

在此处输入图像描述

I uploaded the project in a zip file and binary files were inside the folder. like

在此处输入图像描述

That's created an issue. When you upload.zip files, make sure binary files are in the main root. Not inside any folder.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM