No executable found matching command "dotnet-lambda"
See original GitHub issueI’m not sure the exact cause of this issue but let me describe what I’m seeing in case others are running into this issue. First off, I’m trying to use this extension on my “build machine” which in this case happens to be a Jenkins Slave, a Windows Server 2016 standard.
When I run the command locally, and directly in the Cmd window…
dotnet lambda deploy-function --profile sandbox
… everything works perfectly. However, when I run this same command from my Jenkins (which generates and deploys the script as a .bat file) I get the error
No executable found matching command "dotnet-lambda
Some facts
- I’m logged on as the same user as the Jenkins Windows service
- I’ve already installed the tools (obviously)
- I’m located in the same directory as the .csproj file … this error happens with
donet lambda help
BTW
Work Around
While reading through a very similar issue (https://github.com/ElectronNET/Electron.NET/issues/189) I learned that the actual exe lives at c:\users\{username}\.dotnet\tools\dotnet-lambda.exe
. Therefore I was able to work around this by manually calling the exe like
"%USERPROFILE%\.dotnet\tools\dotnet-lambda.exe" deploy-function --profile %AwsProfileName%
As I mentioned, I’m not sure this is actually an issue with this project or somehow related to the way Jenkins is running the bat file, etc.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
Actually I did run the command
dotnet tool install --global Amazon.Lambda.Tools
just before this call and it responded that it was already installed. So in this case the extension exe is just not resolving for some reason. This is why when I call the extension exe directly it works fine.When you call
dotnet tool install --global Amazon.Lambda.Tools
or some other global tool it ensure the dotnet tools folder is part of the PATH but in your case Jenkins would need to be restarted to pick up the change to the environment variable.