IMethodReturn retvalue = getNext()(input, getNext); if (retvalue.Exception != null) { System.IO.File.AppendAllText("a.txt", retvalue.Exception.ToString()); retvalue.Exception = null; } if (retvalue != null) { var dll = Assembly.Load("AopIntercept"); Type tx = dll.GetType("AopIntercept."+input.Target.ToString().Substring(input.Target.ToString().LastIndexOf(".") + 1) + "Log"); MethodInfo mf = tx.GetMethod("Log"); List<object> list = new List<object>(); list.Add(retvalue.ReturnValue); foreach (var item in input.Inputs) { list.Add(item); } mf.Invoke(null, list.ToArray()); } return retvalue;