简体   繁体   English

.NET 二进制文件缺少 AWS Lambda

[英].NET Binaries Missing AWS Lambda

I have uploaded a .NET6 project as a zip to AWS Lambda, via Visual Studio --> Publish to AWS Lambda however when I test the lambda, I receive this error:我已经通过 Visual Studio 将 .NET6 项目作为 zip 文件上传到 AWS Lambda --> 发布到 AWS Lambda 但是当我测试 lambda 时,我收到了这个错误:

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.

Does anyone have any suggestions for why this may be happening?有没有人对为什么会发生这种情况有任何建议? Isn't AWS Lambda responsible for including the binaries when you publish as a zip?当您发布为 zip 时,AWS Lambda 不负责包含二进制文件吗?

Thanks谢谢

do you somehow have the project marked as self-contained on the msbuild parameters?您是否以某种方式在 msbuild 参数上将该项目标记为独立的? maybe in aws-lambda-tools-defaults.json or custom runtime set in serverless.tempate?也许在 aws-lambda-tools-defaults.json 或在 serverless.tempate 中设置的自定义运行时? It seems it is looking for the dotnet runtime assemblies in your application path它似乎正在您的应用程序路径中寻找 dotnet 运行时程序集

Try checking the lambda configuration in the AWS console.尝试在 AWS 控制台中检查 lambda 配置。

First, check whether there are any clues in the Code ribbons.首先,检查代码色带中是否有任何线索。 If you published through VS, there should be some info like The deployment package of your Lambda function is too large to enable inline code editing and Package size XX.Y MB .如果您通过 VS 发布,应该有一些信息,例如The deployment package of your Lambda function is too large to enable inline code editingPackage size XX.Y MB If there is nothing (which I think will be the case), check your publish setup.如果什么都没有(我认为会是这种情况),请检查您的发布设置。 The lambda runtime container expects code to be present at /var/task . lambda 运行时容器期望代码出现在/var/task中。 If you upload code as zip, it should end up in this directory during lambda container initialization.如果您以 zip 格式上传代码,它应该在 lambda 容器初始化期间最终位于此目录中。

This error message might also indicate that a wrong runtime is used (eg. missing the dotnet runtime inside the Amazon Linux container).此错误消息还可能表明使用了错误的运行时(例如,缺少 Amazon Linux 容器内的 dotnet 运行时)。 The structure of the dotnet runtime image can be examined through a Dockerfile that the image originates from. dotnet 运行时映像的结构可以通过映像源自的Dockerfile检查。

Hope this helps a little.希望这有所帮助。

In my case, I use Upload from -.zip features of Lambda.就我而言,我使用从 Lambda 的 -.zip 功能上传

在此处输入图像描述

I uploaded the project in a zip file and binary files were inside the folder.我上传了一个 zip 文件中的项目,二进制文件在文件夹中。 like

在此处输入图像描述

That's created an issue.这就产生了一个问题。 When you upload.zip files, make sure binary files are in the main root.上传 .zip 文件时,请确保二进制文件位于主根目录中。 Not inside any folder.不在任何文件夹内。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 AWS Lambda GraphicsMagick 错误:找不到 gm/convert 二进制文件” - AWS Lambda GraphicsMagick error: gm/convert binaries can't be found" Lambda 事件缺失数据的 AWS IoT Core - AWS IoT Core for Lambda event missing data .NET Core cookie 身份验证与 AWS Lambda 不持久 - .NET Core cookie authentication with AWS Lambda not persisting 使用 Cognito 登录 AWS Lambda.Net Core - Login in AWS Lambda .Net Core with Cognito .Net Core - AWS Lambda 启用 DI 的项目 - .Net Core - AWS Lambda Project enabling DI 在 AWS Lambda function 中运行 Sharp 时出错:darwin-x64' 二进制文件不能在 'linux-x64' 平台上使用 - Error running Sharp inside AWS Lambda function: darwin-x64' binaries cannot be used on the 'linux-x64' platform .Net Minimal API 和 AWS Lambda 反序列化问题 - .Net Minimal API and AWS Lambda Deserialization Issue COM 不受支持:AWS 中的 PlatformNotSupportedException Lambda .net 3.1 - COM is not supported: PlatformNotSupportedException in AWS Lambda .net 3.1 AWS API 网关 - lambda 集成缺少授权 header - AWS API Gateway - lambda integration missing authorization header aws lambda json 反序列化为缺失的属性提供默认值 - Aws lambda json deserilisation provides default values for missing properties
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM