Viewing the IL code generated from a compiled expression
问题 Is it possible to view the IL code generated when you call Compile() on an Expression tree? Consider this very simple example: class Program { public int Value { get; set; } static void Main(string[] args) { var param = Expression.Parameter(typeof(Program)); var con = Expression.Constant(5); var prop = Expression.Property(param, typeof(Program).GetProperty(\"Value\")); var assign = Expression.Assign(prop, con); Action<Program> lambda = Expression.Lambda<Action<Program>>(assign, param).Compile