I've created a simple empty AWS Lambda function using .Net Core 2.1 :
Here is the folder structure :
(here is the csproj)
And a FunctionHandler which gets DI and invoke some dummy method :
Now let's run the "Mock Lambda Test Tool" , we can see that it works :
So where is the problem?
I've read here that 2.2 is supported :
This means you can now author Lambda functions using .NET Core 2.2 and .NET Core 3.0 preview. Amazon.Lambda.RuntimeSupport is available as source code on GitHub, or as a NuGet package.
And so , I've created a new empty lambda project but with 2.2 :
- Here are the changes in the CSPROJ file
- And here are the changes in the aws-lambda-tools-defaults.json file
Same code. But now when I run "Mock Lambda Test Tool" , I get an error :
AWS .NET Mock Lambda Test Tool (0.9.2) Unknown error occurred causing process exit: Failed to find a deps.json file at Amazon.Lambda.TestTool.Runtime.LocalLambdaRuntime.Initialize(String directory) in E:\JenkinsWorkspaces\Lam\LambdaSandboxCoreCLRApi\Tools\LambdaTestTool\Amazon.Lambda.TestTool\Runtime\LocalLambdaRuntime.cs:line 50 at Amazon.Lambda.TestTool.Program.Main(String[] args) in E:\JenkinsWorkspaces\Lam\LambdaSandboxCoreCLRApi\Tools\LambdaTestTool\Amazon.Lambda.TestTool\Program.cs:line 46 Press any key to exit
Here is the error :
Question:
Why is that? I didn't have any deps.json
file in 2.1 .
So why do I need it in 2.2 ?
Also, what is this path appearing in the error: E:\JenkinsWorkspaces
... ?
I don't have Jenkins nor something like it.