I am running this bit of code:
string serialized = JsonConvert.SerializeObject(somethingToSend);
And it throws this exception:
MissingMethodException: Could not load type 'System.Runtime.Serialization.StreamingContext' from assembly 'mscorlib, Version=3.5.0.0, Culture=neutral, PublicKeyToken=969DB8053D3322AC'.
Here is my configuration:
- Visual Studio 2008 (with all the latest service packs etc)
- Smart Device project targeting Windows Mobile 6 .Net 3.5
- Json DotNet version 4.5 Release 7 (referencing the DLL from the WindowsPhone folder in the zip)
The answer to this question "Is there a library to read JSON in C# on Windows Mobile?" implies that it should work.
I am running it in debug with the real device attached (so no emulator) where I have previously installed the CAB file from here without error:
C:Program Files (x86)Microsoft.NETSDKCompactFrameworkv3.5WindowsCENETCFv35.wce.armv4.cab
The application runs fine until I click the button that is running the line above, so does anyone know what I am missing?
This thread "Json.Compact.dll for Windows CE 5.0?" suggests that I would need the Windows SDK installed, which I have. Given it is running on the device itself I guess that is not going to be the fix anyway.
The other suggestion is to build from source but like the author of the question I cannot load the project file into VS 2008 to do that. I could create a new project and include the source files and try to get it to compile but before I do that I thought I would ask here if it is worth it or if there is something else missing from the installation on the device perhaps? Or maybe I should be using an alternate build?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…