"/var/task directory is missing the required .deps.json file" error started happening on previously deployed SAM stack #1605
-
When I attempted to redeploy an updated Lambda function with SAM, I started receiving the 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 the required .deps.json file." I reverted the changes and tried to redeploy an older version with no avail. I checked the output of the package and noted the .dep.json file was not in the root as required. I am not aware of updating anything myself, however what could be the reason this previously worked but not any longer? I also found when I manually packaged the Lambda with dotnet lambda package the .deps.json was in the correct location and I was able to manually upload the package. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
Can you make sure in your project file it has the following property in a PropertyGroup The dotnet lambda package command will always set the /:GenerateRuntimeConfigurationFiles=true command line property when doing the package. |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
-
The other thing to check is make sure you've run |
Beta Was this translation helpful? Give feedback.
Can you make sure in your project file it has the following property in a PropertyGroup
true
The dotnet lambda package command will always set the /:GenerateRuntimeConfigurationFiles=true command line property when doing the package.
By default the *.deps.json file is not created by the dotnet publish command for class libraries and this property force it to be created.
Answer: