title: Viewing the IL code generated from a compiled expression
body: <p>Is it possible to view the IL code generated when you call Compile() on an Expression tree?  Consider this very simple example:</p>
  
  <pre><code>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&lt;Program&gt; lambda = Expression.Lambda&lt;Action&lt;Program&gt;&gt;(assign, param).Compile();
  
          Program p = new Program();
          lambda(p);
  
  
  
          //p.Value = 5;
      }
  }
  </code></pre>
  
  <p>Now, the expression tree does what the last line of <code>Main</code> says.  Compile the application, then open it in Reflector.  You can see the IL code of <code>p.Value = 5;</code> that does the assignment.  But the expression tree was made and compiled at runtime.  Is it possible to view the resulting IL code from the compile?</p>