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.

JTran
gefragt vor 2 Monaten178 Aufrufe
2 Antworten
1

Hello, I will try that and provide an update.

JTran
beantwortet vor 2 Monaten
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
EXPERTE
beantwortet vor 2 Monaten
profile picture
EXPERTE
überprüft vor einem Monat

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen