dynamic d1 = d + "add it";
That's not a binary operation, that's string concatenation. Documented in the MSDN article for DynamicObject.TryBinaryOperation(), the Add operation has this description:
An addition operation without overflow checking, for numeric operands.
The binder already knows how to concatenate strings. All that's required is to get your DynamicObject converted to a string. Which you can see by adding the ToString() override:
public override string ToString() {
return base.ToString();
}
Set a breakpoint on it and look at the call stack when it breaks:
ConsoleApplication327.exe!ConsoleApplication327.MyDynamic.ToString() Line 22 C# mscorlib.dll!string.Concat(object arg0, object arg1) + 0x1e bytes
System.Core.dll!System.Dynamic.UpdateDelegates.UpdateAndExecute2(System.Runtime.CompilerServices.CallSite site, object arg0, string arg1) + 0x2ae bytes
ConsoleApplication327.exe!ConsoleApplication327.Program.Main(string[] args) Line 30 + 0x146 bytes C#
Line #30 is the d1
assignment statement in my test program.