Could not load file or assembly 'System.Runtime' Error when using JsonConvert.SerializeObject

Aug 9, 2013 at 1:07 AM
Hi,

I've created a Portable Class Library, using the nuget packages for JSON.NET and the Async package

when i try and serialise a class within the portable library i get this error, in my unit test project

Could not load file or assembly 'System.Runtime, Version=1.5.11.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

I only seem to get it when there is an public async method on the class. if i recreate the class in the test project then it works fine. the error only occurs when calling into the portable library
Aug 9, 2013 at 1:34 PM
found a solution here http://blogs.msdn.com/b/bclteam/p/asynctargetingpackkb.aspx

it seems i need to manually edit the app config as nuget isn't doing this correctly for different frameworks.

the two solutions i found worked were either to change the version number to 4.0.0.0 for example. or just to comment it out entirely.