Creating a zip file for my Lambda

0

Hello! I wanted to ask if you could provide some insights into an error I am running into when I run the command line below to create a zip file for my lambda?

Command line: dotnet lambda package --configuration release --framework net6.0 --output-package releases/test.zip

Error: The type or namespace DynamoDBv2 does not exist in the Namespace 'Amazon' (are you missing an assembly reference)?

I am following the steps from the documentation linked: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/CodeSamples.DotNet.html

I have installed the NuGet pkg: AWSSDK.DynamoDBv2 (3.7.301.20) numerous times, and each time I run the command line after, then I get the error and my NuGet pkg is still there but there is now a warning icon over it.

I've ran the command line before in the past with other AWS resources like SQS, so I am not sure why the error is occurring.

preguntada hace 9 meses409 visualizaciones
2 Respuestas
1

Hello, I will try that and provide an update.

respondido hace 9 meses
0

Is the AWSSDK.DynamoDBv2 package is installed in the Lambda project itself? It's important that the package is referenced directly by the project being packaged. If it's only included in a dependent project, ensure that the dependencies are correctly being resolved. Try to open your Lambda function's .csproj file to verify that the AWSSDK.DynamoDBv2 package reference exists:

<ItemGroup>
  <PackageReference Include="AWSSDK.DynamoDBv2" Version="3.7.301.22" />
</ItemGroup>

If it's missing, add it manually or re-install the package using the command line:

dotnet add package AWSSDK.DynamoDBv2 --version 3.7.301.22

Before running the dotnet lambda package command, make sure all NuGet packages are restored properly to resolve any missing dependencies:

dotnet restore

References:

profile picture
EXPERTO
respondido hace 9 meses
profile picture
EXPERTO
revisado hace 8 meses

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas