-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TargetParameterCountException deserializing Generic List (.NET 2.0) #37
Comments
This bug seems to affects .net 4.0 too. Seems like we have tests for Could you create a unit test and send a PR. Thanks. |
I fixed the issue for my project by modifying the code below. Adding the following to the GetConstructorInfo
|
@Terricide can u send a PR. You will first need to send a PR to the reflection-utils project. https://github.com/facebook-csharp-sdk/reflection-utils |
When deserializing a Generic List (as in the example below), SimpleJson throws
TargetParameterCountException
when the Target framework for the Project is set to .NET 2.0.I think the problem is caused by
ContructorDelegateFactory
inSimpleJson.PocoJsonSerializerStrategy
which callsReflectionUtils.GetContructor
to get a constructor for the generic List with no arguments. The constructor is later invoked (byDeserializeObject
) with the number of items in the list as first and only argument.If I change the code in
ContructorDelegateFactory
to account for Lists, it seems to work:The text was updated successfully, but these errors were encountered: