Method not found: 'Void System.Text.Json.Serialization.Metadata.JsonObjectInfoValues1<MyLambda.MyDataTransferObject>.set_ConstructorAttributeProviderFactory(System.Func
1<System.Reflection.ICustomAttributeProvider>)'
#1944
Labels
Describe the bug
Dear community,
I migrated an AWS lambda function from dotnet6.0 to dotnet8.0 by following the steps described here (Migrating from .NET 6 to .NET 8 Native AOT). When using the source generator class with name
SourceGeneratorLambdaJsonSerializer
I'm getting the following error on runtime in AWS (see the stack trace in Additional Information):Error converting the Lambda event JSON payload to type MyLambda.MyDataTransferObject: Method not found: 'Void System.Text.Json.Serialization.Metadata.JsonObjectInfoValues
1<MyLambda.MyDataTransferObject>.set_ConstructorAttributeProviderFactory(System.Func
1<System.Reflection.ICustomAttributeProvider>)'.Any help would be appreciated.
Thank you!
Regression Issue
Expected Behavior
The deserialization of the class
MyDataTransferObject
should be possible when using the generated source.Current Behavior
When having an additional project reference (dotnet8.0) the
MyDataTransferObject
cannot be deserialized.Reproduction Steps
Possible Solution
This problem occurs only on AWS and cannot be reproduced with the dotnet-lambda-test-tool-8.0 locally. I'm not sure if it is a dotnet problem or a AWS problem. Anyway I have found the following issue which might be related:
1.set_ObjectCreator(System.Func
1<!0>)'. with .NET Standard 2.0 dotnet/runtime#61737I don't use any .netstandard libraries.
Additional Information/Context
AWS .NET SDK and/or Package version used
Targeted .NET Platform
.NET Core 8.0
Operating System and version
AmazonLinux
The text was updated successfully, but these errors were encountered: