System.ArrayTypeMismatchException When Using ConfigurationBuilder In Lambda With Lambda Test Tool #1846
Labels
bug
This issue is a bug.
closing-soon
This issue will automatically close in 4 days unless further comments are made.
module/lambda-test-tool
needs-reproduction
This issue needs reproduction.
p2
This is a standard priority issue
response-requested
Waiting on additional info and feedback. Will move to close soon in 7 days.
Describe the bug
I am attempting to write a Lambda that requires Serilog to be configured during startup. In order to do this I am using the following code in my main Function class relying on environment variables:
When I step over the first line, the ConfigurationBuilder returned has thrown a
System.ArgumentException
. When I step over the second line the call toBuild()
returns aSystem.ArrayTypeMismatchException
. For testing, I removed even the call toAddEnvironmentVariables()
with no improvement. I reproduced the example in a brand new Lambda project using the SQS template.I have tested a similar config setup in a basic .NET BackgroundService with no issues.
Regression Issue
Expected Behavior
I expect the ConfigurationBuilder to be able to load environment variables into memory for use later in the application.
Current Behavior
The newly created ConfigurationBuilder throws System.ArgumentException on all properties.
Building the ConfigurationBuilder produces a System.ArrayTypeMismatchException.
Reproduction Steps
Function.cs:
launchSettings.json
csproj
aws-lambda-tools-defaults
Possible Solution
No response
Additional Information/Context
No response
AWS .NET SDK and/or Package version used
Amazon.Lambda.Serialization.SystemTextJson 2.4.3
Amazon.Lambda.Core 2.3.0
Amazon.Lambda.SQSEvents 2.2.0
AWSSDK.Extensions.NETCore.Setup 3.7.301
Targeted .NET Platform
.NET 8
Operating System and version
MacOS Sequoia 15.0.1
The text was updated successfully, but these errors were encountered: