NuGet package for version uses Newtonsoft.Json 4.0.4 - causes type load exception - workaround


NuGet package for version uses Newtonsoft.Json 4.0.4.
Using WP7.1, the Newtonsoft.Json 4.0.4 version caused an unhandled type load exception in ResourceClientFactory when using the BingMapsService.
System.TypeLoadException was unhandled. Message=Could not load type 'WP7Contrib.Communications.ResourceClientFactory' from assembly 'WP7Contrib.Communications, Version=
Struggled with this for a few hours and finally worked around this issue when using Newtonsoft.Json 4.0.3.
Closed Nov 30, 2011 at 10:34 AM by oriches
Fixed issue


oriches wrote Nov 29, 2011 at 11:00 PM

Do you have any example code?

hconr wrote Nov 30, 2011 at 7:59 AM

The BingMapsService requires a resourceHandlerFactory parameter, so it fails with this simple test:
ResourceClientFactory factory = new ResourceClientFactory(new DebugLog());

oriches wrote Nov 30, 2011 at 10:33 AM

Corrected the problem - it seems it automatically updated JSON.Net and this broke the contrib.

I've pushed out a new build 1.6

wrote Nov 30, 2011 at 10:34 AM

hconr wrote Nov 30, 2011 at 9:30 PM

Thanks for the quick response and fix

Oluf wrote Dec 17, 2011 at 8:47 PM

It seems like this is a general issue when using WP7Contrib via NuGet. The Newtonsooft.Json library was recently updated to 4.0.5 and as a result WP7Contrib broke again in the same way. Perhaps the NuGet package needs to be authored so it depends on a specific Newtonsoft.Json version and doesn't just pull the latest? I don't really know what I'm talking about, since I know next to nothing about NuGet and such, but I imagine this might be needed.

adogg wrote Nov 16, 2012 at 7:54 AM

It looks like now it's the same with and Newtonsoft.Json 4.0.8.

wrote Feb 14, 2013 at 6:15 PM

wrote May 16, 2013 at 8:00 AM