This comes from this question really: Looping through JSON array and adding items to list C# .
To not derail that question completely, I ask a new one that I started to wonder about.
Using Json.net, why does this code work:
dynamic test = new JValue("test"); string s = test;
dynamic test = new JValue("test"); var list = new List<string>(); list.Add(test);
RuntimeBinderException: The best overloaded method match for '
System.Collections.Generic.List<string>.Add(string)' has some invalid arguments
Given that there is just one overload for the
Add method, and it takes a string, why won't it silently do the runtime conversion here as well?