This project has moved. For the latest updates, please go here.

Upgrade from 3.5 to 45r8

Oct 24, 2012 at 7:41 PM

We're in the process of updating some older code to work with VS2010 and .NET 4.0. One of the projects is an older version of TweetSharp. I was able to build it with just a few minor tweaks (add a parameter to match the newer JsonConverter.JsonRead method and change the IsRequired property to Required on the JsonProperty attribute).

However, the code is failing to deserialize custom types.

When I step through JsonSerializerInternalReader.CreateNewObject, everything looks good until we're ready to return. I have a TweetSharp object created by objectContract.DefaultCreator, but createdFromNonDefaultConstructor is false which makes the calling CreateObject take the wrong path and my Twitter object gets lost.

I've been looking for some default behavior that's changed between the two versions and am coming up empty handed.

I don't really know anything about JSON.NET internals so it's just dumb luck that I've narrowed it down this far.

Can anyone give me some insight into how I can fix this behavior?