1

Closed

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

description

NuGet package for version 1.0.0.15 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=1.0.0.15
 
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 11:34 AM by oriches
Fixed issue

comments

oriches wrote Nov 30, 2011 at 12:00 AM

Do you have any example code?

hconr wrote Nov 30, 2011 at 8: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 11: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 11:34 AM

hconr wrote Nov 30, 2011 at 10:30 PM

Thanks for the quick response and fix

Oluf wrote Dec 17, 2011 at 9: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 8:54 AM

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

wrote Feb 14, 2013 at 7:15 PM

wrote May 16, 2013 at 9:00 AM