A tool for easy IL code inspection
Sometimes I would like to quickly see the IL representation of my code snippets in C#, to understand what exactly happens to various code statements under the hood, like it's done [here for example][1].

I know there are [ildasm][2], [Reflector][3], [ILSpy][4], [dotPeek][5] and probably quite some other tools available. What I'm wondering here is that if there is any more elegant way from writing some lines of code to seeing the corresponding IL, than compiling your .net code, loading the assembly into one of those programs and finding the code you are curious about.

Maybe having a plugin for visual studio, which would add a right click option for "build and see IL code" or any other convenient way?



  [1]: http://blogs.msdn.com/b/jmstall/archive/2005/03/09/390135.aspx
  [2]: http://msdn.microsoft.com/en-us/library/f7dy01k1%28v=vs.80%29.aspx
  [3]: http://www.reflector.net/
  [4]: http://wiki.sharpdevelop.net/ILSpy.ashx
  [5]: http://www.jetbrains.com/decompiler/
A tool for easy IL code inspection
===

Sometimes I would like to quickly see the IL representation of my code snippets in C#, to understand what exactly happens to various code statements under the hood, like it's done [here for example][1].

I know there are [ildasm][2], [Reflector][3], [ILSpy][4], [dotPeek][5] and probably quite some other tools available. What I'm wondering here is that if there is any more elegant way from writing some lines of code to seeing the corresponding IL, than compiling your .net code, loading the assembly into one of those programs and finding the code you are curious about.

Maybe having a plugin for visual studio, which would add a right click option for "build and see IL code" or any other convenient way?



  [1]: http://blogs.msdn.com/b/jmstall/archive/2005/03/09/390135.aspx
  [2]: http://msdn.microsoft.com/en-us/library/f7dy01k1%28v=vs.80%29.aspx
  [3]: http://www.reflector.net/
  [4]: http://wiki.sharpdevelop.net/ILSpy.ashx
  [5]: http://www.jetbrains.com/decompiler/