Could not find the required *.deps.json for .NET Core AWS Serverless Application

Viewed 1932
  • Create new Visual Studio solution based on template 'AWS Serverless Application (.NET Core - C#)
  • Scaffold an ASP.NET Core Web API
  • Run sam local start-api -t serverless.template in the project folder
  • Make a GET request to http://localhost:3000/api/values
  • Results in error:

    Invalid API Gateway Response Keys: {'errorMessage', 'errorType'} in {'errorType': 'LambdaException', 'errorMessage': "Could not find the required 'AWSServerless1.deps.json'. This file should be present at the root of the deployment package."}

I haven't made any changes to the solution created from the Visual Studio template.

Could not find required deps json

1 Answers

Fixed by updating serverless.template to contain:

"CodeUri": "bin/Release/netcoreapp3.1"

Then: dotnet publish -c Release before running the sam local start-api -t serverless.template command.

Related