I have a JSON string that is received via a WebSocket and I have to deserialize it and then call a method on it. Let's suppose I also know it's type, but only in run-time as well.
var value = GetJson();
var type = Assembly.LoadWithPartialName("xxx").GetType("yyy");
var req = JsonConvert.DeserializeObject(value, type);
req.DoAction();
As a result I get an error that says 'object' does not contain a definition for 'DoAction' and no accessible extension method 'DoAction'