I have created a .Net Core 2.0 Web API and am trying to deploy it using Visual Studio Team Services and the AWS Lambda .Net Tools, according to this: https://aws.amazon.com/blogs/developer/working-with-lambda-functions-and-visual-studio-team-services/.
But when the task runs in VSTS it throws this error:
No executable found matching command "dotnet-lambda"
Here is the full log of the task:
2018-01-27T02:55:21.9538582Z ##[section]Starting: Deploy to Lambda:
2018-01-27T02:55:21.9749412Z ==============================================================================
2018-01-27T02:55:21.9749717Z Task : AWS Lambda .NET Core Deployment
2018-01-27T02:55:21.9749955Z Description : Build and deploy a Serverless .NET Core application or AWS Lambda function
2018-01-27T02:55:21.9750152Z Version : 1.0.17
2018-01-27T02:55:21.9750334Z Author : Amazon Web Services
2018-01-27T02:55:21.9750571Z Help : Please refer to [AWS Lambda Developer Guide](https://docs.aws.amazon.com/lambda/latest/dg/) for more information on working with AWS Lambda.
2018-01-27T02:55:21.9750859Z ==============================================================================
2018-01-27T02:55:23.4482254Z d4194695-5ae1-4063-ab6c-c39aa4079814 exists true
2018-01-27T02:55:23.4524112Z Deploying Lambda project at d:\a\1\s
2018-01-27T02:55:23.4545880Z Beginning dotnet restore
2018-01-27T02:55:23.4729777Z Path to tool: C:\Program Files\dotnet\dotnet.exe
2018-01-27T02:55:23.4760281Z [command]"C:\Program Files\dotnet\dotnet.exe" restore
2018-01-27T02:55:25.2373341Z Restoring packages for d:\a\1\s\SimOpSolutions.API\SimOpSolutions.API.csproj...
2018-01-27T02:55:25.2374456Z Restoring packages for d:\a\1\s\SimOpSolutions.Domain\SimOpSolutions.Domain.csproj...
2018-01-27T02:55:35.5704175Z Installing System.Threading.Overlapped 4.3.0.
2018-01-27T02:55:35.5879102Z Installing System.Net.WebHeaderCollection 4.3.0.
2018-01-27T02:55:35.6356230Z Installing System.Net.NetworkInformation 4.3.0.
2018-01-27T02:55:35.6438188Z Installing System.Data.Common 4.3.0.
2018-01-27T02:55:35.6990259Z Installing ServiceStack.Text.Core 5.0.2.
2018-01-27T02:55:35.6999574Z Installing ServiceStack.Interfaces.Core 5.0.2.
2018-01-27T02:55:35.7024446Z Installing System.Xml.XmlSerializer 4.3.0.
2018-01-27T02:55:35.7541486Z Installing System.Net.Requests 4.3.0.
2018-01-27T02:55:35.8301653Z Installing System.Reflection.DispatchProxy 4.4.0.
2018-01-27T02:55:35.8311199Z Installing System.Net.Http.WinHttpHandler 4.4.0.
2018-01-27T02:55:35.8311429Z Installing System.Net.WebHeaderCollection 4.0.1.
2018-01-27T02:55:35.8313073Z Installing MediatR.Extensions.Microsoft.DependencyInjection 4.0.0.
2018-01-27T02:55:35.8469303Z Installing MediatR 4.0.1.
2018-01-27T02:55:35.9290745Z Installing ServiceStack.Common.Core 5.0.2.
2018-01-27T02:55:35.9305266Z Installing ServiceStack.Client.Core 5.0.2.
2018-01-27T02:55:35.9315268Z Installing System.Linq.Queryable 4.3.0.
2018-01-27T02:55:36.3981940Z Installing System.Private.ServiceModel 4.4.0.
2018-01-27T02:55:36.5638519Z Installing System.Net.Requests 4.0.11.
2018-01-27T02:55:37.1019223Z Installing Bogus 22.0.2.
2018-01-27T02:55:37.2144033Z Installing FluentValidation.AspNetCore 7.4.0.
2018-01-27T02:55:38.3640693Z Installing AWSSDK.DynamoDBv2 3.3.5.
2018-01-27T02:55:38.4332497Z Installing ServiceStack.Aws.Core 5.0.2.
2018-01-27T02:55:40.1039314Z Installing FluentValidation 7.4.0.
2018-01-27T02:55:40.4885137Z Installing AWSSDK.Core 3.3.19.
2018-01-27T02:55:40.7273199Z Installing AWSSDK.S3 3.3.16.2.
2018-01-27T02:55:44.9860545Z Installing AWSSDK.SQS 3.3.3.2.
2018-01-27T02:55:45.3974215Z Installing System.ServiceModel.Primitives 4.4.0.
2018-01-27T02:55:48.0217564Z Installing AWSSDK.Core 3.3.21.6.
2018-01-27T02:55:48.3023994Z Installing ServiceStack.Core 5.0.2.
2018-01-27T02:56:24.2979807Z Installing System.Globalization 4.3.0-preview1-24530-04.
2018-01-27T02:56:24.3991676Z Installing Microsoft.NETCore.Targets 1.1.0-preview1-24530-04.
2018-01-27T02:56:24.5524420Z Installing Microsoft.NETCore.Platforms 1.1.0-preview1-24530-04.
2018-01-27T02:56:24.7613877Z Installing Microsoft.AspNetCore.Http.Features 1.0.3.
2018-01-27T02:56:24.9467558Z Installing System.Net.WebSockets 4.0.0.
2018-01-27T02:56:25.2402869Z Installing AWSSDK.CloudFormation 3.3.9.
2018-01-27T02:56:25.3091012Z Installing Microsoft.Extensions.Localization.Abstractions 1.0.3.
2018-01-27T02:56:25.4939689Z Installing AWSSDK.IdentityManagement 3.3.5.3.
2018-01-27T02:56:25.5379484Z Installing Microsoft.DotNet.InternalAbstractions 1.0.0.
2018-01-27T02:56:25.6977057Z Installing Microsoft.Extensions.ObjectPool 1.0.1.
2018-01-27T02:56:25.9898745Z Installing Microsoft.AspNetCore.WebUtilities 1.0.3.
2018-01-27T02:56:26.0239197Z Installing Microsoft.AspNetCore.Routing.Abstractions 1.0.4.
2018-01-27T02:56:26.0953771Z Installing AWSSDK.Lambda 3.3.12.
2018-01-27T02:56:26.2492646Z Installing Microsoft.AspNetCore.Hosting.Server.Abstractions 1.0.3.
2018-01-27T02:56:26.2862688Z Installing AWSSDK.Extensions.NETCore.Setup 3.3.4.
2018-01-27T02:56:26.4454096Z Installing System.Security.Claims 4.0.1.
2018-01-27T02:56:26.5571073Z Installing Amazon.Lambda.AspNetCoreServer 2.0.0.
2018-01-27T02:56:26.7962213Z Installing System.Resources.ResourceManager 4.3.0-preview1-24530-04.
2018-01-27T02:56:26.9275190Z Installing System.Runtime 4.3.0-preview1-24530-04.
2018-01-27T02:56:27.0346748Z Installing AWSSDK.Route53 3.3.13.
2018-01-27T02:56:27.0776396Z Installing EnyimMemcachedCore 2.1.0.2.
2018-01-27T02:56:27.0795680Z Installing System.Collections 4.3.0-preview1-24530-04.
2018-01-27T02:56:28.1480472Z Installing System.ComponentModel.Primitives 4.1.0.
2018-01-27T02:56:28.2575492Z Installing FluentScheduler 5.3.0.
2018-01-27T02:56:28.5952544Z Installing Amazon.Lambda.Core 1.0.0.
2018-01-27T02:56:29.0640692Z Installing Amazon.Lambda.Logging.AspNetCore 2.0.0.
2018-01-27T02:56:29.0642148Z Installing Amazon.Lambda.Serialization.Json 1.1.0.
2018-01-27T02:56:29.4093064Z Installing Newtonsoft.Json 10.0.3.
2018-01-27T02:56:30.2697878Z Installing Swashbuckle.AspNetCore 1.1.0.
2018-01-27T02:56:30.2918015Z Installing System.Runtime.Loader 4.3.0.
2018-01-27T02:56:30.4510158Z Installing YamlDotNet.Signed 4.3.0.
2018-01-27T02:56:30.7186809Z Installing Swashbuckle.AspNetCore.SwaggerUI 1.1.0.
2018-01-27T02:56:31.9071285Z Installing Swashbuckle.AspNetCore.Swagger 1.1.0.
2018-01-27T02:56:32.0019769Z Installing Swashbuckle.AspNetCore.SwaggerGen 1.1.0.
2018-01-27T02:56:32.4263403Z Installing AWSSDK.Core 3.3.13.3.
2018-01-27T02:56:33.5812531Z Installing Microsoft.Extensions.Configuration.Abstractions 1.0.2.
2018-01-27T02:56:33.7809983Z Installing Microsoft.Extensions.DependencyInjection.Abstractions 1.0.2.
2018-01-27T02:56:33.8890341Z Installing Amazon.Lambda.APIGatewayEvents 1.1.1.
2018-01-27T02:56:34.0549459Z Installing Microsoft.AspNetCore.Hosting 1.0.0.
2018-01-27T02:56:34.3940158Z Installing Microsoft.Extensions.Configuration 1.0.0.
2018-01-27T02:56:34.7082747Z Installing Microsoft.Extensions.DiagnosticAdapter 1.0.0.
2018-01-27T02:56:34.8651409Z Installing Microsoft.Extensions.Logging.Abstractions 1.0.0.
2018-01-27T02:56:34.9448306Z Installing Microsoft.AspNetCore.StaticFiles 1.0.4.
2018-01-27T02:56:34.9454751Z Installing Microsoft.Extensions.FileProviders.Embedded 1.0.1.
2018-01-27T02:56:35.1961654Z Installing System.Xml.XPath 4.0.0.
2018-01-27T02:56:35.2657937Z Installing AutoMapper 6.2.2.
2018-01-27T02:56:35.3431628Z Installing AWSSDK.CloudFront 3.3.6.1.
2018-01-27T02:56:36.9277797Z Installing AWSSDK.CognitoIdentity 3.3.2.17.
2018-01-27T02:56:36.9937610Z Installing AWSSDK.CognitoIdentityProvider 3.3.8.
2018-01-27T02:56:37.0874877Z Installing Microsoft.IdentityModel.Logging 1.1.5.
2018-01-27T02:56:37.1878915Z Installing AWSSDK.Route53Domains 3.3.1.3.
2018-01-27T02:56:37.4613163Z Installing BouncyCastle.NetCore 1.8.1.3.
2018-01-27T02:56:37.5422426Z Installing Microsoft.IdentityModel.Protocols.OpenIdConnect 2.1.5.
2018-01-27T02:56:37.6076035Z Installing JWT 3.1.1.
2018-01-27T02:56:37.6904483Z Installing System.IdentityModel.Tokens.Jwt 5.1.5.
2018-01-27T02:56:37.7316937Z Installing RestSharp.NetCore 105.2.3.
2018-01-27T02:56:38.0596877Z Installing Microsoft.AspNetCore.Mvc.Core 1.0.4.
2018-01-27T02:56:38.1068926Z Installing Microsoft.AspNetCore.Mvc.Formatters.Json 1.0.4.
2018-01-27T02:56:38.1077196Z Installing Microsoft.AspNetCore.Mvc.ApiExplorer 1.0.4.
2018-01-27T02:56:38.1225080Z Installing Microsoft.AspNetCore.Mvc.DataAnnotations 1.0.4.
2018-01-27T02:56:39.0309484Z Installing Microsoft.Extensions.Primitives 1.0.1.
2018-01-27T02:56:39.1692383Z Installing System.ComponentModel 4.0.1.
2018-01-27T02:56:39.5362783Z Installing System.Linq.Expressions 4.1.1.
2018-01-27T02:56:40.4614046Z Installing System.Diagnostics.StackTrace 4.0.1.
2018-01-27T02:56:40.5563460Z Installing Microsoft.AspNetCore.Hosting.Abstractions 1.0.0.
2018-01-27T02:56:40.5755326Z Installing Microsoft.AspNetCore.Hosting.Server.Abstractions 1.0.0.
2018-01-27T02:56:40.7212997Z Installing Microsoft.AspNetCore.Http 1.0.0.
2018-01-27T02:56:40.7777494Z Installing Microsoft.AspNetCore.Http.Extensions 1.0.0.
2018-01-27T02:56:40.7966177Z Installing Microsoft.Extensions.FileProviders.Physical 1.0.0.
2018-01-27T02:56:40.8577722Z Installing Microsoft.Extensions.Options 1.0.0.
2018-01-27T02:56:40.9128086Z Installing Microsoft.Extensions.DependencyInjection 1.0.0.
2018-01-27T02:56:41.5171542Z Installing Microsoft.Extensions.PlatformAbstractions 1.0.0.
2018-01-27T02:56:41.5591083Z Installing Microsoft.Extensions.Configuration.Abstractions 1.0.0.
2018-01-27T02:56:41.6475736Z Installing Microsoft.Extensions.DependencyInjection.Abstractions 1.0.0.
2018-01-27T02:56:41.8938566Z Installing Microsoft.AspNetCore.Http.Extensions 1.0.3.
2018-01-27T02:56:45.0979387Z Installing Microsoft.AspNetCore.Hosting.Abstractions 1.0.4.
2018-01-27T02:56:45.0980587Z Installing Microsoft.Extensions.FileProviders.Abstractions 1.0.1.
2018-01-27T02:56:45.0981410Z Installing System.Text.Encodings.Web 4.0.1.
2018-01-27T02:56:45.0982053Z Installing Microsoft.Extensions.Logging.Abstractions 1.0.2.
2018-01-27T02:56:45.0982656Z Installing Microsoft.Extensions.WebEncoders 1.0.3.
2018-01-27T02:56:45.0983470Z Installing AWSSDK.SecurityToken 3.3.3.3.
2018-01-27T02:56:45.0983969Z Installing Microsoft.IdentityModel.Protocols 2.1.5.
2018-01-27T02:56:45.2247233Z Installing Microsoft.IdentityModel.Tokens 5.1.5.
2018-01-27T02:56:45.2611182Z Installing System.ComponentModel.TypeConverter 4.1.0.
2018-01-27T02:56:45.2791682Z Installing System.Collections.Specialized 4.0.1.
2018-01-27T02:56:45.2846406Z Installing System.Runtime.Serialization.Formatters 4.3.0-preview1-24530-04.
2018-01-27T02:56:45.8789195Z Installing Microsoft.AspNetCore.Authorization 1.0.3.
2018-01-27T02:56:45.8789800Z Installing Microsoft.AspNetCore.Hosting.Abstractions 1.0.3.
2018-01-27T02:56:45.9626175Z Installing Microsoft.Extensions.Options 1.0.2.
2018-01-27T02:56:45.9769780Z Installing Microsoft.AspNetCore.Mvc.Abstractions 1.0.4.
2018-01-27T02:56:45.9906831Z Installing Microsoft.AspNetCore.Http 1.0.3.
2018-01-27T02:56:46.0981601Z Installing Microsoft.Extensions.DependencyModel 1.0.0.
2018-01-27T02:56:46.4138385Z Installing Microsoft.AspNetCore.JsonPatch 1.0.0.
2018-01-27T02:56:47.6568391Z Installing System.ComponentModel.Annotations 4.1.0.
2018-01-27T02:56:47.8091994Z Installing Microsoft.AspNetCore.Hosting.Server.Abstractions 1.0.4.
2018-01-27T02:56:48.0526415Z Installing Microsoft.Extensions.Localization 1.0.3.
2018-01-27T02:56:48.1983931Z Installing Microsoft.AspNetCore.Http.Abstractions 1.0.0.
2018-01-27T02:56:48.2288283Z Installing Microsoft.Extensions.FileProviders.Abstractions 1.0.0.
2018-01-27T02:56:48.5258234Z Installing Microsoft.AspNetCore.Http.Features 1.0.0.
2018-01-27T02:56:48.8960676Z Installing Microsoft.AspNetCore.WebUtilities 1.0.0.
2018-01-27T02:56:49.0181709Z Installing Microsoft.Extensions.ObjectPool 1.0.0.
2018-01-27T02:56:49.2159622Z Installing Microsoft.Net.Http.Headers 1.0.0.
2018-01-27T02:56:50.5518262Z Installing System.IO.FileSystem.Watcher 4.0.0.
2018-01-27T02:56:50.5519211Z Installing Microsoft.Extensions.FileSystemGlobbing 1.0.0.
2018-01-27T02:56:50.5519880Z Installing Microsoft.Extensions.Primitives 1.0.0.
2018-01-27T02:56:50.5520167Z Installing Microsoft.AspNetCore.Http.Abstractions 1.0.3.
2018-01-27T02:56:50.5520585Z Installing Microsoft.Net.Http.Headers 1.0.3.
2018-01-27T02:57:01.1940712Z d:\a\1\s\SimOpSolutions.API\SimOpSolutions.API.csproj : warning NU1603: RestSharp.NetCore 105.2.3 depends on System.Runtime.Serialization.Formatters (>= 4.0.0-rc4-24217-03) but System.Runtime.Serialization.Formatters 4.0.0-rc4-24217-03 was not found. An approximate best match of System.Runtime.Serialization.Formatters 4.3.0-preview1-24530-04 was resolved. [d:\a\1\s\SimOpSolutions.sln]
2018-01-27T02:58:17.0409023Z Generating MSBuild file d:\a\1\s\SimOpSolutions.Domain\obj\SimOpSolutions.Domain.csproj.nuget.g.props.
2018-01-27T02:58:19.4261118Z Generating MSBuild file d:\a\1\s\SimOpSolutions.Domain\obj\SimOpSolutions.Domain.csproj.nuget.g.targets.
2018-01-27T02:58:19.4275775Z Restore completed in 2.83 min for d:\a\1\s\SimOpSolutions.Domain\SimOpSolutions.Domain.csproj.
2018-01-27T02:58:19.4276367Z Restoring packages for d:\a\1\s\SimOpSolutions.Infrastructure\SimOpSolutions.Infrastructure.csproj...
2018-01-27T02:58:25.1466415Z Generating MSBuild file d:\a\1\s\SimOpSolutions.API\obj\SimOpSolutions.API.csproj.nuget.g.props.
2018-01-27T02:58:25.1469733Z Generating MSBuild file d:\a\1\s\SimOpSolutions.API\obj\SimOpSolutions.API.csproj.nuget.g.targets.
2018-01-27T02:58:25.1683187Z Restore completed in 3 min for d:\a\1\s\SimOpSolutions.API\SimOpSolutions.API.csproj.
2018-01-27T02:58:25.1705188Z Restoring packages for d:\a\1\s\SimOpSolutions.Tasks\SimOpSolutions.Tasks.csproj...
2018-01-27T02:58:25.2725896Z d:\a\1\s\SimOpSolutions.Tasks\SimOpSolutions.Tasks.csproj : warning NU1603: RestSharp.NetCore 105.2.3 depends on System.Runtime.Serialization.Formatters (>= 4.0.0-rc4-24217-03) but System.Runtime.Serialization.Formatters 4.0.0-rc4-24217-03 was not found. An approximate best match of System.Runtime.Serialization.Formatters 4.3.0-preview1-24530-04 was resolved. [d:\a\1\s\SimOpSolutions.sln]
2018-01-27T02:58:25.3842785Z Generating MSBuild file d:\a\1\s\SimOpSolutions.Tasks\obj\SimOpSolutions.Tasks.csproj.nuget.g.props.
2018-01-27T02:58:25.3849002Z Generating MSBuild file d:\a\1\s\SimOpSolutions.Tasks\obj\SimOpSolutions.Tasks.csproj.nuget.g.targets.
2018-01-27T02:58:25.4011791Z Restore completed in 215.01 ms for d:\a\1\s\SimOpSolutions.Tasks\SimOpSolutions.Tasks.csproj.
2018-01-27T02:58:25.4034095Z Restoring packages for d:\a\1\s\SimOpSolutions.API\SimOpSolutions.API.csproj...
2018-01-27T02:58:28.0818820Z Generating MSBuild file d:\a\1\s\SimOpSolutions.Infrastructure\obj\SimOpSolutions.Infrastructure.csproj.nuget.g.props.
2018-01-27T02:58:28.0819787Z Generating MSBuild file d:\a\1\s\SimOpSolutions.Infrastructure\obj\SimOpSolutions.Infrastructure.csproj.nuget.g.targets.
2018-01-27T02:58:28.0958022Z Restore completed in 9.65 sec for d:\a\1\s\SimOpSolutions.Infrastructure\SimOpSolutions.Infrastructure.csproj.
2018-01-27T02:58:28.5158388Z Restoring packages for d:\a\1\s\SimOpSolutions.API\SimOpSolutions.API.csproj...
2018-01-27T02:58:28.7015042Z Installing YamlDotNet.Signed 4.2.1.
2018-01-27T02:58:28.7015669Z Installing AWSSDK.Lambda 3.3.10.
2018-01-27T02:58:28.7016068Z Installing Amazon.Lambda.Tools 2.0.1.
2018-01-27T02:59:49.1223089Z Installing Microsoft.VisualStudio.Web.CodeGeneration.Contracts 2.0.1.
2018-01-27T02:59:49.1248772Z Installing Microsoft.VisualStudio.Web.CodeGeneration.Tools 2.0.1.
2018-01-27T02:59:56.4196984Z Restore completed in 1.47 min for d:\a\1\s\SimOpSolutions.API\SimOpSolutions.API.csproj.
2018-01-27T02:59:56.8923026Z Restore completed in 1.52 min for d:\a\1\s\SimOpSolutions.API\SimOpSolutions.API.csproj.
2018-01-27T02:59:56.9548214Z Beginning Serverless Deployment
2018-01-27T02:59:56.9549299Z Path to tool: C:\Program Files\dotnet\dotnet.exe
2018-01-27T02:59:56.9552784Z [command]"C:\Program Files\dotnet\dotnet.exe" lambda deploy-serverless --disable-interactive true --region us-east-1
2018-01-27T02:59:57.1481754Z No executable found matching command "dotnet-lambda"
2018-01-27T02:59:57.2033504Z ##[error]Error: C:\Program Files\dotnet\dotnet.exe failed with return code: 1
2018-01-27T02:59:57.2414775Z ##[section]Finishing: Deploy to Lambda:
I had to add a DotNetCliToolReference to the lambda tools in my .csproj file of the lambda project:
<ItemGroup>
<DotNetCliToolReference Include="Amazon.Lambda.Tools" Version="2.2.0" />
</ItemGroup>
I got similar issue, and below is how I solve it
install Amazon.Lambda.Tools to the gloable, you can build it anywhere
dotnet tool install --global Amazon.Lambda.Tools --version 3.1.1
update to latest version
dotnet tool update --global Amazon.Lambda.Tools
then you can build in by cmd line in the project folder
dotnet-lambda package
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With