3

I am just trying to use Visual Studio Code to work on AWS lambda function and following steps in this link

After following all steps when I run dotnet lambda I keep getting following error. My all packages are up to date and also I am using core 2.1

PS C:\Lambda> dotnet lambda --help
No executable found matching command "dotnet-lambda"

My Project File:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>netcoreapp2.1</TargetFramework>
    <GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
    <AWSProjectType>Lambda</AWSProjectType>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Amazon.Lambda.Core" Version="1.0.0" />
    <PackageReference Include="Amazon.Lambda.Serialization.Json" Version="1.4.0" />
  </ItemGroup>

</Project>

Here is my project structure look like which was created by the template

enter image description here

VS Code version

enter image description here

Also when I run dotnet --help I don't even see dotnet lambda in sdk

dotnet --help
.NET Command Line Tools (2.1.403)
Usage: dotnet [runtime-options] [path-to-application] [arguments]

Execute a .NET Core application.

runtime-options:
  --additionalprobingpath <path>     Path containing probing policy and assemblies to probe for.
  --additional-deps <path>           Path to additional deps.json file.
  --fx-version <version>             Version of the installed Shared Framework to use to run the application.
  --roll-forward-on-no-candidate-fx  Roll forward on no candidate shared framework is enabled.

path-to-application:
  The path to an application .dll file to execute.

Usage: dotnet [sdk-options] [command] [command-options] [arguments]

Execute a .NET Core SDK command.

sdk-options:
  -d|--diagnostics  Enable diagnostic output.
  -h|--help         Show command line help.
  --info            Display .NET Core information.
  --list-runtimes   Display the installed runtimes.
  --list-sdks       Display the installed SDKs.
  --version         Display .NET Core SDK version in use.

SDK commands:
  add               Add a package or reference to a .NET project.
  build             Build a .NET project.
  build-server      Interact with servers started by a build.
  clean             Clean build outputs of a .NET project.
  help              Show command line help.
  list              List project references of a .NET project.
  migrate           Migrate a project.json project to an MSBuild project.
  msbuild           Run Microsoft Build Engine (MSBuild) commands.
  new               Create a new .NET project or file.
  nuget             Provides additional NuGet commands.
  pack              Create a NuGet package.
  publish           Publish a .NET project for deployment.
  remove            Remove a package or reference from a .NET project.
  restore           Restore dependencies specified in a .NET project.
  run               Build and run a .NET project output.
  sln               Modify Visual Studio solution files.
  store             Store the specified assemblies in the runtime package store.
  test              Run unit tests using the test runner specified in a .NET project.
  tool              Install or manage tools that extend the .NET experience.
  vstest            Run Microsoft Test Engine (VSTest) commands.

Additional commands from bundled tools:
  dev-certs         Create and manage development certificates.
  ef                Entity Framework Core command-line tools.
  sql-cache         SQL Server cache command-line tools.
  user-secrets      Manage development user secrets.
  watch             Start a file watcher that runs a command when files change.

Run 'dotnet [command] --help' for more information on a command.

Can someone please guide me

Thanks

6
  • 2
    Install Amazon Lambda Tools dotnet tool install -g Amazon.Lambda.Tools Commented Oct 11, 2018 at 13:14
  • 1
    dotnet tool install -g Amazon.Lambda.Tools Tool 'amazon.lambda.tools' is already installed. Commented Oct 11, 2018 at 13:44
  • and still nothing for dotnet lambda? check that the folder containing the tools is in your $PATH. Commented Oct 11, 2018 at 15:31
  • Yes still same I have already installed lambda tools before I started this project Commented Oct 12, 2018 at 13:46
  • same issue here, could you resolve this somehow?. thanks. Commented Dec 11, 2018 at 14:58

2 Answers 2

1

I got similar issue, No executable found matching command "dotnet-lambda"

and below is my fix

dotnet tool install --global Amazon.Lambda.Tools --version 3.1.2

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

0

Restarting VS Code after running

dotnet tool install -g Amazon.Lambda.Tools

Worked for me

2 Comments

Is this not what this answer suggested?
I feel the part about restarting VS Code was relevant as the solution will not work without that step, however I was unable to comment due to reputation requirements.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.