0

I received following error in CloudWatch Logs after using AWS CodePipeline (AWS CodeBuild) to deploy my C# Lambda Function Code

Could not find the required 'MyAssembly.deps.json'.
This file should be present at the root of the deployment package.: LambdaException
Ryan Williams
  • 1,465
  • 15
  • 19

2 Answers2

1

The problem in my case was that the linux file permissions on files inside the Zip were set to 000; so when the zip was extracted by AWS Lambda; AWS Lambda did not have file permission to access the file MyAssembly.deps.json

I was using C# System.IO.Compression.ZipFile.CreateFromDirectory to author the zip file. I had to shell out to the native zip program to produce a zip file which worked.

Big thanks to https://forums.aws.amazon.com/message.jspa?messageID=856247

Ryan Williams
  • 1,465
  • 15
  • 19
0

I know this is bit old question but writing answer for any user who are still facing the problem on windows system. this is with dotnet core 3.1 The first command in package manager console to ensure the .deps.json included in publish files dotnet publish /p:GenerateRuntimeConfigurationFiles=true

and than zip all files of publish folder in the same name of namespace folder. upload the zip file to AWS lambda using console. worked. If not than copy all project files ( not the published) in zip and upload to aws lambda.

Gaurav Upadhyay
  • 414
  • 4
  • 12