Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RuntimeBinderException when parsing json with Newtonsoft.Json

I'm trying to parse simple json to dynamic object in Windows phone 8. I'm using Newtonsoft.JSON library with this code:

dynamic response = JObject.Parse(responseText);
string streamRequestUrl = response._links.streams;

I can that _links are present there enter image description here But when I try to read it I get Microsoft.CSharp.RuntimeBinder.RuntimeBinderException. How to get _links property value out of it?

like image 966
Sly Avatar asked Mar 05 '26 04:03

Sly


1 Answers

I was hitting something similar in VS 2015. The approach using [] to access the properties works, however if I enable "Just My Code" in Tools > Options > Debugging > General. I was able to use the properties on the dynamic objects as normal e.g. code like: response._links.streams; worked.

See this other post with a similar question

like image 65
Justin Slone Avatar answered Mar 06 '26 19:03

Justin Slone