public IMethodReturn Invoke(IMethodInvocation input, GetNextHandlerDelegate getNext) { Console.WriteLine("方法名:{0}", input.MethodBase.Name); Console.WriteLine("参数:"); for (var i = 0; i < input.Arguments.Count; i++) { Console.WriteLine("{0}={1}", input.Arguments.ParameterName(i), input.Arguments[i].ToString()); } //Console.WriteLine("返回类型:{0}", input.MethodBase.MemberType.GetTypeCode().ToString()); Console.WriteLine("返回类型:{0}", ((MethodInfo)(input.MethodBase)).ReturnType.FullName); Console.WriteLine("执行前"); var retValue = getNext()(input, getNext); if (retValue.Exception == null) { Console.WriteLine("没有异常"); } else { Console.WriteLine("有异常{0}", retValue.Exception.Message); retValue.Exception = null; } Console.WriteLine("执行后"); return retValue; }