You have built a .net core based AWS lambda package and now you wish to publish it.
Googling the internet you find that this can be done by running the following script:
dotnet lambda package -o ..\lambda-1.zip
It throws the error: “dotnet : No executeable found matching command “dotnet-lambda”
You Lambda project requires some special tools that provide the aws lambda packager.
The Solution .net core 2.x
Edit your .net core project file and ensure that the following block exists as an item group
<itemgroup> <dotnetclitoolreference include="Amazon.Lambda.Tools" version="2.2.0"> </dotnetclitoolreference></itemgroup>
Restore the packages, (dotnet restore), and retry the “package” command and the lambda should now build and be packed into your lambda-1.zip file.
The Solution .net core 3.x
In .net core 3.x, things have changed and you no longer need to include the client tool reference as part of the project file.
Instead you need to install the Amazon Lambda tools as a globally accessible tool. Run the following common to install
dotnet tool install --global Amazon.Lambda.Tools
The nuget package details are here: