-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
TypeConverter is ignored when reading a value that implements IConvertible #676
Comments
It's even more interesting with
even though |
By design. You will need to override with a JsonConverter. |
@JamesNK That's what I wanted to use, but |
You could write a JsonConverter for the dictionary. Or you could deserialize to different type and then create the dictionary after you deserialize. |
This really sounds like a bug. I've observed the same problem. Everything works as expected until your target object implements |
Getting the same, I just add a custom object to my app that implements IConvertible and now I can't serialize/deserialize... Currently looking for a workaround, any idea? |
Try adding [JsonObject] attribute above the class implementing the IConvertible interface. |
Adding [JsonObject] fixed this for me. |
Example code (https://dotnetfiddle.net/iGB2mc):
Produces
However if I remove
IConvertible
fromX
, it works.The text was updated successfully, but these errors were encountered: