---
title: "IL Debug Visualizer for Compiled Lambda Expressions, MethodBase and DynamicMethod"
url: "https://osherove.com/blog/2007/11/29/il-debug-visualizer-for-compiled-lambda-expressions-methodba.md"
canonical: "https://osherove.com/blog/2007/11/29/il-debug-visualizer-for-compiled-lambda-expressions-methodba.html"
published: "2007-11-29T02:07:36"
updated: "2007-11-29T02:07:36"
tags: [".NET", "CLR", "Cool Tools"]
author: "Roy Osherove"
description: "Mark Watts just emailed me with cool news. He took the Dynamic Method visualizers I worked on and created a version of them that will also work and show the IL on Lambda Expressions. here's the full list of changes he…"
usage: "Licensed under CC BY 4.0 — reuse, quote and adapt with attribution (Roy Osherove, link to the original page)."
license: "https://creativecommons.org/licenses/by/4.0/"
---

# IL Debug Visualizer for Compiled Lambda Expressions, MethodBase and DynamicMethod

By Roy Osherove November 29, 2007 In [.NET](https://osherove.com/blog/category/net), [CLR](https://osherove.com/blog/category/clr), [Cool Tools](https://osherove.com/blog/category/cool-tools)

**Historical article** · Originally published November 29, 2007; technical details may be outdated.

Mark Watts just emailed me with cool news. He took the [Dynamic Method visualizers I worked on](http://weblogs.asp.net/rosherove/archive/2007/11/02/debugger-visualizers-for-methodinfo-dynamicmethod-and-methodbase.aspx) and created a version of them that will also work and show the IL on Lambda Expressions. here's the full list of changes he did to the source code:

1) Solution and projects all coverted over to VS2008

2) References to Microsoft.VisualStudio.DebuggerVisualizers updated to version 9

3) M3 and M4 methods added in the test project to demonstrate how to use the new functionality

4) MethodBodyVisualizer added DebuggerVisualizer attribute to target Delegates - not 100% certain this is safe but there is a lot of spelunking around where the brave fear to tread in this project. :)

5) ILReader project

    \* Updated ILReaderFactory.GetReader to attempt to recognize when the target is a lamda expression and retrieve the correct MethodBase for it.

    \* Updated DynamicScopeTokenResolver to handle GenericFieldInfo - Compiled Expressions store strings and the like in a global generic field array that is part of the delegate and is of type GenericFieldInfo.

\* [Download available here](http://teamagile.com/Downloads/MethodVisualizers08_Src.zip) -

Install:

\- take the dlls from the bin directory

\- put them under my documents\\visual studio\\visualizers.

\- if the directory does not exist, create it.

## More in .NET

[All posts in .NET](https://osherove.com/blog/category/net)

- Jan 17, 2008

    ### [Debug into the .NET Framework Library Source Code - It's here.](https://osherove.com/blog/2008/1/17/debug-into-the-net-framework-library-source-code-its-here.html)

- Jan 15, 2008

    ### [BitDiffer, anyone?](https://osherove.com/blog/2008/1/15/bitdiffer-anyone.html)

- Nov 19, 2007

    ### [Debug Into the .NET Framework Source Code](https://osherove.com/blog/2007/11/19/debug-into-the-net-framework-source-code.html)

- Nov 17, 2007

    ### [Mocking LINQ Queries, Extension methods and Anonymous Types](https://osherove.com/blog/2007/11/17/mocking-linq-queries-extension-methods-and-anonymous-types.html)


---

## About the author

**Roy Osherove**: Senior Solutions Architect at AWS working on AI for production and AI-driven development; author of The Art of Unit Testing and Elastic Leadership, with about 20 years of consulting and training on unit testing, TDD, team leadership and continuous delivery.

### Sites

- [RobotPaper](https://robotpaper.ai/): This blog: AI patterns and anti-patterns, AI and coding agents, and engineering leadership.
- [osherove.com](https://osherove.com): Roy's personal site. Author of The Art of Unit Testing and Elastic Leadership; consulting and training on unit testing, TDD, team leadership and continuous delivery, plus about 20 years of blog posts.
- [The Art of Unit Testing](https://www.artofunittesting.com): The Art of Unit Testing, 3rd Edition (Manning): readable, maintainable, trustworthy unit tests, plus TDD workshops in C#, JavaScript, Java and Kotlin.
- [5whys.com](https://www.5whys.com): Roy's writing on software team leadership: self-organizing teams, surviving chaos, learning mode and the Elastic Leadership model.
- [Pipeline Driven](https://pipelinedriven.org): Continuous delivery and DevOps practices: build patterns, pipeline-friendly testing, DevOps metrics and enterprise DevOps.
- [Elastic Leadership](https://www.elasticleadership.com): Elastic Leadership, Roy's framework for software team leaders (survival, learning and self-organizing modes).

### Social

- X: https://x.com/royosherove
- LinkedIn: https://www.linkedin.com/in/osherove/

### Contact

- Contact form: https://forms.gle/jQSx5KoXvrVA1JCK7

### License

Licensed under CC BY 4.0 — reuse, quote and adapt with attribution (Roy Osherove, link to the original page). License: https://creativecommons.org/licenses/by/4.0/
