找不到 .NET Core AWS 无服务器应用程序所需的 *.deps.json
Could not find the required *.deps.json for .NET Core AWS Serverless Application
- 基于模板“AWS 无服务器应用程序 (.NET Core - C#)
创建新的 Visual Studio 解决方案
- 搭建 ASP.NET 核心网络 API
- 运行
sam local start-api -t serverless.template
在项目文件夹中
- 向 http://localhost:3000/api/values
发出 GET 请求
- 结果错误:
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."}
我没有对从 Visual Studio 模板创建的解决方案进行任何更改。
已通过更新 serverless.template
以包含:
进行修复
"CodeUri": "bin/Release/netcoreapp3.1"
然后:dotnet publish -c Release
在 运行 sam local start-api -t serverless.template
命令之前。
- 基于模板“AWS 无服务器应用程序 (.NET Core - C#) 创建新的 Visual Studio 解决方案
- 搭建 ASP.NET 核心网络 API
- 运行
sam local start-api -t serverless.template
在项目文件夹中 - 向 http://localhost:3000/api/values 发出 GET 请求
- 结果错误:
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."}
我没有对从 Visual Studio 模板创建的解决方案进行任何更改。
已通过更新 serverless.template
以包含:
"CodeUri": "bin/Release/netcoreapp3.1"
然后:dotnet publish -c Release
在 运行 sam local start-api -t serverless.template
命令之前。