I am trying to run an AWS Lambda function that I have uploaded via Visual Studio 2022 on a Windows 10 PC. The function was successfully uploaded as a zip file. There were no errors during the upload. My Lambda function targets the .Net 6 framework using the x86_64 architecture.
When I attempt to run the Lambda function, a failure message is returned immediately. It reads.
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 the required .deps.json file. INIT_REPORT Init Duration: 19.54 ms Phase: init Status: error Error Type: Runtime.ExitError 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 the required .deps.json file. INIT_REPORT Init Duration: 11.66 ms Phase: invoke Status: error Error Type: Runtime.ExitError START RequestId: 2dd64b40-d091-498e-81f5-05154f51a4ef Version: $LATEST RequestId: 2dd64b40-d091-498e-81f5-05154f51a4ef Error: Runtime exited with error: exit status 105 Runtime.ExitError END RequestId: 2dd64b40-d091-498e-81f5-05154f51a4ef REPORT RequestId: 2dd64b40-d091-498e-81f5-05154f51a4ef Duration: 12.53 ms Billed Duration: 13 ms Memory Size: 512 MB Max Memory Used: 3 MB
I inspected the zip file used by the upload. Every dll in that zip file which was created from a visual studio project has a matching deps.json file. Dlls that have been loaded from other dependencies (e.g. Amazon.Lambda.Core) do not have a json file.
I have tried the suggestions from an earlier post on the same error. A link to that post is included below. None of the suggestions in this post resolve my issue.
.NET Binaries Missing AWS Lambda
There is a blog post that suggests this error may be caused by a namespace conflict; however, no such conflicts exist in my case. https://greghalter.com/aws-lambda-issue-missing-the-required-deps-json-file/
Any assistance on the error I am experiencing will be greatly appreciated.
Thanks
I found the cause for my error.
In the AWS console, there is a "Handler" setting under "Runtime settings" under the "Code" tab for AWS lambda functions. My value for this setting was incorrect. It needs to be [assembly]::[namespace].[class name containing function handler]::[name of function handler]