小编Dev*_*per的帖子

C# AWS Lambda 函数 - 找不到文件名为“LambdaTest、Culture=neutral、PublicKeyToken=null”的指定处理程序程序集

我正在尝试创建一个“Hello, World”AWS Lambda 函数,但有一个小小的更改:我需要使用 .zip 文件来部署它。为了实现这一目标,我做了以下工作:

从终端窗口

  1. 使用初始化新的 AWS Lambda 函数dotnet new lambda.EmptyFunction --name myFirstFunction --profile default --region us-east-1

  2. cd进入myFirstFunction

  3. 跑步dotnet publish ./src/myFirstFunction/myFirstFunction.csproj

  4. 导航到./src/myFirstFunction/bin/Debug/net6.0/publish

  5. 将所有文件压缩到一个名为Archive.zip.

从浏览器中的 AWS 控制台

  1. 导航到myFirstFunctionLambda 函数。

  2. 单击“代码源”部分中的“上传自 -> .zip 文件”

  3. 选择Archive.zip

  4. 成功上传后导航至“测试”选项卡

  5. 单击“测试事件”部分中的“测试”按钮

此时,我收到一条错误消息:

{
  "errorType": "LambdaValidationException",
  "errorMessage": "Could not find the specified handler assembly with the file name 'LambdaTest, Culture=neutral, PublicKeyToken=null'. The assembly should be located in the root of your uploaded .zip file.",
  "stackTrace": …
Run Code Online (Sandbox Code Playgroud)

c# amazon-web-services aws-lambda

4
推荐指数
1
解决办法
5719
查看次数

标签 统计

amazon-web-services ×1

aws-lambda ×1

c# ×1