Skip to content

Aspire 13.2 broke AWS Lambda Integration #15606

@normj

Description

@normj

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Starting with Aspire 13.2 our AWS Lambda integration broke when launched in debug mode from Visual Studio. For .NET Lambda we have 2 different programming models. The complicated one for Aspire and which broke with 13.2 is where a Lambda function is defined in a class library. Our integration during startup generates a launch profile in the .NET Lambda project's launchSettings.json that sets up the bootstrapping executable and then we specify that launch profile for the project being launched within Aspire.

  "profiles": {
    "Aspire_my-lambda": {
      "commandName": "Executable",
      "executablePath": "dotnet",
      "commandLineArgs": "exec --depsfile ./MyLambdaFunction.deps.json --runtimeconfig ./MyLambdaFunction.runtimeconfig.json %USERPROFILE%\\.dotnet\\tools\\.store\\amazon.lambda.testtool\\0.13.0\\amazon.lambda.testtool\\0.13.0\\content\\Amazon.Lambda.RuntimeSupport\\net10.0\\Amazon.Lambda.RuntimeSupport.TestTool.dll MyLambdaFunction::MyLambdaFunction.Function::FunctionHandler",
      "workingDirectory": "bin\\Debug\\net10.0\\"
    }
   ...
,

In Aspire 9.x up to 13.1 this worked fine but with 13.2 it fails with the log output indicating it doesn't like that we are using a class library even though this technic worked for us before.

Unable to proceed with project 'C:\Temp\AddAWSLambdaFunctionRepro\MyLambdaFunction\MyLambdaFunction.csproj'.
 Ensure you have a runnable project type.
 A runnable project should target a runnable TFM (for instance, net11.0) and have OutputType 'Exe'.
 The current OutputType is 'Library'.

Expected Behavior

.NET Lambda function defined in a class library is executed following the configuration we setup in the launchSettings.json file.

Steps To Reproduce

We have the following repo you can clone and reproduce the issue by opening the solution and launching the AppHost. The Lambda function will show finished right away. The repo does not require an AWS account to use.
https://github.com/dscpinheiro/AddAWSLambdaFunctionRepro

Exceptions (if any)

No response

.NET Version info

No response

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-toolingvsIssues related to Visual Studio tooling for aspire‼️regression-from-last-releaseThis used to work in an earlier version of Aspire and we broke it!

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions