[Mono-list] Not implemented exceptions in Getters
curylod at asme.org
Sun Jul 13 03:31:15 UTC 2014
Hello, there. I don't know enough about what you're trying to do to be
able to propose a viable option, just trying to help you out, and if you
can't set the properties on deserialization, it seems worthless to
serialize them. Anyway, you're clearly not serializing a hashtable of
string:string. Doing so requires no custom serialization and as you
pointed out, your stack trace shows the exception serializing FieldInfo.
But if you're writing something that is so tightly coupled to .NET that
you're serializing reflection types, then why bother with JSON
On Saturday, July 12, 2014, Kevin Connell <kevin at connells.net> wrote:
> Ummm.. dont think its a viable option to not serialize get only
> I have been able to work around it but it's just stupid to have had to
> create a custom serialization routine for string:string in a hashtable.
> On Jul 12, 2014 9:08 PM, "Dave Curylo" <curylod at asme.org
>> Git blame shows Marek Safar added those properties. They are needed for
>> .NET 4.0 compatibility, but since mono does not support code access
>> security, they can't really be supported. The argument could be made for
>> these to return false since everything running under mono essentially runs
>> as fully trusted and nothing gets special treatment as "security critical"
>> code. Code access security is not implemented, but then at least these
>> properties could be.
>> To solve your immediate problem, you could provide a custom
>> IContractResolver and tell it to ignore get-only properties, which would
>> cover these that aren't implemented. Chances are good if you're
>> serializing types you can't control, you'll eventually need this sort of
>> customization anyway. See here for an example:
>> On Saturday, July 12, 2014, Kevin Connell <kevin at connells.net
>>> Line 281
>>> Sorry, Not sure on the process for a pull request, but its a getter on a
>>> public property with a throw in the main branch,and its the same property
>>> that is indicated in the stack trace I sent.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Mono-list