Closed Beau-Gosse-dev closed 1 year ago
Change has been released in Amazon.Lambda.Tools version 5.6.5.
Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.
Describe the bug
If you set self-contained in the csproj file, the code here ignores it and only looks at msbuild parameters passed through the CLI. This is a problem when using SAM CLI, since they don't provide a way to pass msbuild parameters through the CLI call to Amazon.Lambda.Tools.
Expected Behavior
If self-contained is set to true, and publish aot is false (both in the csproj file), the app should still publish as self-contained.
Current Behavior
Because publish aot is false, self-contained defaults to false
Reproduction Steps
dotnet new lambda.CustomRuntimeFunction
Remove
"msbuild-parameters": "--self-contained true"
from aws-lambda-tools-defaults.jsonAdd
<SelfContained>true</SelfContained>
to csproj fileOr a more realistic example would be to try and publish a non-native AOT .NET 7 custom runtime function using SAM CLI.
Possible Solution
https://github.com/aws/aws-extensions-for-dotnet-cli/pull/271
Additional Information/Context
No response
Targeted .NET platform
.NET 7 custom runtime
CLI extension version
amazon.lambda.tools 5.6.3 dotnet-lambda
Environment details (OS name and version, etc.)
windows 10