JsonSerializer and IntPtr #47164
Replies: 2 comments 3 replies
-
... and what would you expect to happen on deserialization? The value hopefully won't be valid (if it is, you could have far worse problems). |
Beta Was this translation helpful? Give feedback.
-
FWIW the I agree with @tannergooding's analysis above. If you imagine that (Also, please don't serialize actual handle values. They're almost certainly not going to be valid on the other side.) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
This snippet (using .net 5)
returns
{"Handle":{}}
.Given that
IntPtr
implementsISerializable
I'd expect thatIntPtr
is serialized as a number in json. Why can't I serialize theIntPtr
? And why do I get an empty object instead of an exception that the type isn't supported?Beta Was this translation helpful? Give feedback.
All reactions