I\'ve got an ExpandoObject that I\'m sending to an external library method which takes an object. From what I\'ve seen this external lib uses TypeDescriptor.GetProperties in
The only way I could get the OP's code to work with Marc's ExpandoTypeDescriptor code was to modify the OP's call to GetTypeDescriptor, casting the return value to ExpandoObject.
public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object instance)
{
var defaultDescriptor = base.GetTypeDescriptor(objectType, instance);
return instance == null ? defaultDescriptor :
new ExpandoTypeDescriptor((ExpandoObject)instance);
}