Exception when serializing an abstract generic property

I just ran into a little problem with the json serializer. I have an abstract base class that sits on top of my domain model. This class is generic so I can pass the Type of the database identifier to it.
When I serialize such an object I get the following exception:

Newtonsoft.Json.JsonSerializationException: A member with the name 'Id' already exists on NewtonSoftBug.Tests+AbstractGenericBase`1[System.Int32]. Use the JsonPropertyAttribute to specify another name.

I've fixed this issue and checked the change into CodePlex. Try building from the latest source and see how you go.

If you're interested the issue is caused by weirdness in the .NET GetProperties method around abstract generic types - http://forums.msdn.microsoft.com/en-US/netfxbcl/thread/b5abbfee-e292-4a64-8907-4e3f0fb90cd9/

thanks for the fix and link detailing the origin of this issue :)
I'll give it a spin when I'm at work tomorrow.

cheers,

Ernst.

On Sat, Aug 16, 2008 at 10:54 AM, JamesNK <notifications@codeplex.com> wrote:
> From: JamesNK
>
> Thanks for submitting such a detailed report of the bug!
>
> I've fixed this issue and checked the change into CodePlex. Try building
> from the latest source and see how you go.
>
> If you're interested the issue is caused by weirdness in the .NET
> GetProperties method around abstract generic types -
> http://forums.msdn.microsoft.com/en-US/netfxbcl/thread/b5abbfee-e292-4a64-8907-4e3f0fb90cd9/
>
> ~ James
>
> Read the full discussion online.
>
> To add a post to this discussion, reply to this email
> ([email removed])
>
> To start a new discussion for this project, email
> [email removed]
>
> You are receiving this email because you subscribed to this discussion on
> CodePlex. You can unsubscribe on codePlex.com.
>
> Please note: Images and attachments will be removed from emails. Any posts
> to this discussion will also be available online at codeplex.com