[Mono-list] Not implemented exceptions in Getters

Kevin Connell kevin at connells.net
Sun Jul 13 01:46:07 UTC 2014


Ummm.. dont think its a viable option to not serialize get only
properties.

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.
Hello.

On Jul 12, 2014 9:08 PM, "Dave Curylo" <curylod at asme.org> wrote:

> 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:
>
>
> http://stackoverflow.com/questions/18543482/c-sharp-is-there-a-way-to-ignore-get-only-properties-in-json-net-serializer-with
>
> On Saturday, July 12, 2014, Kevin Connell <kevin at connells.net> wrote:
>
>>
>> https://github.com/mono/mono/blob/master/mcs/class/corlib/System.Reflection/FieldInfo.cs
>>
>> 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.
>>
>> cc:author
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-list/attachments/20140712/ab978a96/attachment.html>


More information about the Mono-list mailing list