Skip to content
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

Support for deserializing dictionary with integer key #2

Closed
mikaelharsjo opened this issue Aug 24, 2012 · 1 comment
Closed

Support for deserializing dictionary with integer key #2

mikaelharsjo opened this issue Aug 24, 2012 · 1 comment

Comments

@mikaelharsjo
Copy link
Contributor

When trying to deserialize my object containing the dictionary I get: Cannot deserialilze json into dictionary of type System.Int32. Dictionary key type must be string.

@jlarsson
Copy link
Owner

Fixed. In general, dictionary keys can be of any type, but if

System.Convert.ChangeType(<member name>,typeof(TKey))

fails, deserialization throws an informative exception.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants