aws-sam-cli
aws-sam-cli copied to clipboard
sam build and dotnet lambda package-ci produce different templates
Description
sam build and dotnet lambda package-ci produce different templates
Steps to reproduce
- Create AWS Serverless App (C#) with Visual Studio 2019 AWS Toolkit.
- Make sure you can successfully publish it from Visual Studio using 'publish AWS lambda"
- Attempt to run it locally using sam local invoke.
- Attempt to run it locally using sam local start-lambda and aws lambda invoke.
- Run sam build and use the template generated to run sam local invoke or sam local start-lambda
Observed result
Both #3 and #4 fail with an error: Could not find the specified handler assembly with the file name 'SmapiLrdService.MS.Serverless, Culture=neutral, PublicKeyToken=null'. The assembly should be located in the root of your uploaded .zip file. #5 succeeds
Expected result
Since this "Hello World" lambda can be deployed successfully from Visual Studio AWS Toolkit serverless project, I would expect SAM CLI to work as well.
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
- OS: Windows
-
sam --version
: 0.17.0
The problem: dotnet lambda package-ci output run by Visual Studio 2019 AWS Toolkit has the same binaries, but slightly different template format from one produced by sam build. It would be beneficial for the teams to get together and resolve the issue.
Add --debug flag to command you are running