I had a similar issue deploying a docker container to AWS Lambda.
I was using a custom container and not the public.ecr.aws/lambda/dotnet:latest
.
Because of this, thelambda-entrypoint.sh
was getting confused about which deps.json
to use and was trying to run dotnet exec
on a random json file.
What ended up solving it was setting the environment variable LAMBDA_DOTNET_MAIN_ASSEMBLY
to the main assembly name - not including .dll
This name should match the name of your .csproj
file. For instance, if your program is myDotnetExample.csproj
you would set the environment variable as:
LAMBDA_DOTNET_MAIN_ASSEMBLY = "myDotnetExample"
Once this variable was set, lambda-entrypoint.sh
was able to find the proper file and run the program.