Logging WCF message sizes
问题 I am using WCF to send some Linq objects across the wire. I want to log message size either using Message logging or tracing. I don't however want, or have the ability to use the config file to set this up. I am struggling to figure out how to do this programatically. I don't care if this happens at the host of client. I control both. Does anyone have experience doing this? 回答1: Marc's right, Message Inspectors will allow you to do this. Create a class that: Implements