I have a static method in MyLibrary1 which returns a dynamic object.
public static dynamic GetObjects()
{
return new { test = "something" };
}
But when I access the above method from MyLibrary2, debugger shows the value and object returned correctly.
dynamic b = MyLibrary1.GetObjects();
string name = b.test;
I get a RuntimeBinderException that says " 'object' does not contain a definition for 'test' when I read b.test.
The same code works as expected when I move the method to the calling library.
Microsoft.CSharp.dll. Like the OP indicated, this works fine for me when calling the method from the console app directly. But putting the exact same code in a library causes the exception. Paging @EricLippert !