Are internal properties deserializable?
I noticed I can't deserialize a class with internal properties. I tried a bunch of work-around solutions, but they didn’t work out. Once I declare the properties public, it just works.


5 Replies
JsonIncludeAttribute Class (System.Text.Json.Serialization)
Indicates that the member should be included for serialization and deserialization.
[JsonInclude] solved the case. Gotta dig deeper to know how this exactly works behind the scenes.
Thanks!
Is there a reason to declare properties internal if the class is already internal
I (and other people I've talked with about this) usually follow this: always specify visibilities on members as if the type was public
that way you don';t need to change anything if the type becomes public and such
Unknown User•4w ago
Message Not Public
Sign In & Join Server To View