1

I'm trying to do some json deserialization on windows phone 7, so I decided to use Newtonsoft.json library, because it seems to support this platform also. Unfortunatelly I'm stuck with these errors:

Error 1 Predefined type 'Microsoft.CSharp.RuntimeBinder.Binder' is not defined or imported

and

Error 4 One or more types required to compile a dynamic expression cannot be found. Are you missing references to Microsoft.CSharp.dll and System.Core.dll?

I found out that I can't just add a reference to Microsoft.CSharp.dll (VS tells me that it wasn't built with Windows Phone runtime) in my project, so what else can be done? I used newtonsoft lib from portable+net40+sl4+wp7+wp8 and then from sl4-windowsphone71 folders in the library. Nothing works.

11
  • Was Json.NET installed via NuGet? Commented Nov 18, 2013 at 20:45
  • Yes, it was installed via NuGet Commented Nov 18, 2013 at 20:47
  • Is it a new project? are you running Visual Studio 2012 with Update 4? also, make sure Nuget itself is up to date. Commented Nov 18, 2013 at 20:51
  • Well, it's a new project for me :). I'm using VS 2010, and nuget 2.7. Commented Nov 18, 2013 at 20:55
  • It's VS 2010 Express for Windows Phone, actually. Commented Nov 18, 2013 at 20:57

1 Answer 1

2

This error relates to dynamic types. Try using the JSON.NET generic methods, with which you specify the deserialization type, instead of the method which returns a dynamic type.

i.e. Don't do this...

http://thewayofcode.wordpress.com/2012/09/18/c-dynamic-object-and-json-serialization-with-json-net/

Do this...

http://www.hanselman.com/blog/NuGetPackageOfTheWeek4DeserializingJSONWithJsonNET.aspx

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.