Currently, not even the simplest examples of using the 'ExpandoObject' work on my machine.
Both
dynamic obj = new ExpandoObject();
obj.Value = 10;
var action = new Action<string>((line) => Console.WriteLine(line));
obj.WriteNow = action;
obj.WriteNow(obj.Value.ToString());
(from this website) and
dynamic sampleObject = new ExpandoObject();
sampleObject.test = "Dynamic Property";
Console.WriteLine(sampleObject.test);
(from the MSDN examples) fail with a RuntimeBinderException. I presume I've misconfigured something, but I am at a loss about what it might be.
I am using .NET v4.0.30319 and Visual Studio 2010 SP1 Premium. Please ask for anything else you might need to know. =)
Deleting the hidden "SolutionName.suo" file in the solution directory fixed this problem for me.
I still have no clue why it occured, though.
Edit: Andras Zoltan, who deleted his answer, guessed correctly. I have had "Break on all Exceptions" enabled and was being stupid. =)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With