During the process of obfuscating a .NET assembly (using Dotfuscator), I have found myself tweaking how things are renamed. This often involves looking at the assembly in ILDASM and tracing a Type back to the source code file that it is defined in.
Usually this is a simple process. But I have found that locating an Anonymous Type is very difficult -- especially in a large assembly.
If I am trying to find the location of an anonymous type, such as the following line of code:
new { Name = 'Gene', Age = 30 }
Which is compiled as:
<>f__AnonymousType0`2'<'<Name>j__TPar','<Age>j__TPar'>`
And appears as the root of the assembly in the ILDASM tree.
If I want to locate the anonymous type in the source code, I am left without much help:
- No Namespace
- No symbols to search on
- Nothing in the Solution Navigator
- Nothing in the Class View
- Nothing in the Object Browser
Am I missing something? Are there any tools to help locate an Anonymous Type in code files?