Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions Libraries/src/Amazon.Lambda.AspNetCoreServer.Hosting/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,28 @@ app.Run();

```

## Important Notes

### Main Method Signature

If you choose to use a `Main` method instead of top-level statements, ensure the method does not accept any parameters. The Lambda runtime attempts to bind the request object to the method parameters, which will cause deserialization errors if the signature includes `string[] args` or other parameters.

```csharp
// Correct - no parameters
public static void Main()
{
var builder = WebApplication.CreateBuilder([]);
// ... rest of the setup
}

// Incorrect - will cause deserialization errors
public static void Main(string[] args)
{
var builder = WebApplication.CreateBuilder(args);
// ... rest of the setup
}
```

## Extension Points

`AddAWSLambdaHosting` accepts an optional `HostingOptions` configuration action that exposes the same customization hooks available in the traditional `AbstractAspNetCoreFunction` base class approach.
Expand Down