I'm using the SimpleJson library from here: http://simplejson.codeplex.com/
I'd like to deserialize a JSON string to an dynamic object like this:
dynamic json = SimpleJson.SimpleJson.DeserializeObject("{\"foo\":\"bar\"}");
var test = json.foo;
The deserialization part works properly, but calling json.foo throws a RuntimeBinderException with the error message 'SimpleJson.JsonObject' does not contain a definition for 'foo'
.
How can I deserialize a JSON string using SimpleJson and access the dynamic properties using the json.foo syntax?