.netamazon-web-servicesdebuggingrideraws-toolkit

Debug AWS Lambda in Rider 2023.1


I have a question in version of Rider: 2021.3.4 I can debug any lambda via dotnet, using next launch setting:

"Mock Lambda Test Tool RIDER DEV": {
"commandName": "Executable",
"commandLineArgs": "--port 5050",
"workingDirectory": "$(ProjectDir)",
"executablePath": "%USERPROFILE%\\.dotnet\\tools\\.store\\amazon.lambda.testtool-6.0\\0.13.0\\amazon.lambda.testtool-6.0\\0.13.0\\tools\\net6.0\\any\\Amazon.Lambda.TestTool.BlazorTester.dll",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
}
}

In all next Rider versions including the last one. This debug configuration doesn't work. For example in version 2023.1.1 (All plugins latest update installed) I've got this erorr:

enter image description here

Do anyone knows how to fix this issue in Rider ?

I've tried to install all versions of rider after 2021.3.4, but still have this issue. And also dotnet 7 and aws toolkit for dotnet 7 and it's lauchsettings, but still got the same issue


Solution

  • From a terminal, make sure you've installed the lambda test tool. If your lambda is written in .NET 6, you'd want to install the .NET 6 lambda test tool with dotnet tool install -g Amazon.Lambda.TestTool-6.0 . For other .NET versions, you'll want to look up the correct tool name on NuGet - https://www.nuget.org/packages?q=Amazon.Lambda.TestTool

    The executable referenced in your launch settings needs to be different for Rider. See https://github.com/aws/aws-lambda-dotnet/tree/master/Tools/LambdaTestTool#configure-for-jetbrains-rider for details, but a reference needs to be made to Amazon.Lambda.TestTool.BlazorTester.dll .

    I found that I had to adjust the launch settings to run dotnet, and pass the dll as a command line arg. You might have success adjusting your launch settings to look something like this:

    {
      "profiles": {
        "Mock Lambda Test Tool Rider": {
          "commandName": "Executable",
          "commandLineArgs": "<YOUR_PATH_WILL_VARY>\\Amazon.Lambda.TestTool.BlazorTester.dll --port 5050",
          "workingDirectory": "$(ProjectDir)",
          "executablePath": "dotnet"
        }
      }
    }