.NET assemblies to C# code
dotPeek decompiles any .NET assemblies based on .NET Framework 1.0 to 4.5 into equivalent C# code. It supports libraries (.dll), executables (.exe), and Windows 8 metadata files (.winmd).
It also decompiles .baml files, enabling you to reconstruct XAML UI definitions.
C# code to Visual Studio projects
As soon as you've decompiled an assembly, you can save it as a Visual Studio project (.csproj).
That helps a lot if you're trying to reconstruct lost source code of an application.
View source code if available
Decompiled code is better than nothing but sometimes you can match an assembly to its source code, so why not take advantage of this? dotPeek can identify local source code based on PDB files, or fetch source code from source servers such as Microsoft Reference Source Center or SymbolSource.org. Moreover, dotPeek can generate PDB files.
Use the navigation mode drop-down in the menu bar to choose whether you only want dotPeek to decompile assemblies, or try find source code if possible.
Installer or executable
dotPeek is distributed in several ways:
- As an .msi installer for easier version management.
- As 32-bit and 64-bit .exe files if you prefer to keep tools like dotPeek in a location shared between your machines.
Open archives or folders
In addition to traditional assemblies and executables, you can have dotPeek open archives (including .zip, .vsix, and .nupkg formats) and folders. For example, when you point dotPeek at a folder, it processes all its subfolders in hunt for files that it can decompile.
Manage assembly lists
You can work with different assembly lists depending on your context. You can save and reopen assembly lists, and clear the current list if you no longer need it. Assembly lists are not limited to .dll and .exe files: they can also contain archives and folders.
Rich Assembly Explorer
When you're working with an assembly list, the Assembly Explorer shows what kind of references, resources, and code a particular assembly has, all the way from namespaces to type members. For each type, it highlights nodes representing its base types and inheritors — in addition to the actual list of members. Quick search and node filtering using lowerCamelHumps are supported as well.
Find usages of any symbol
With dotPeek, you have several options to search where code symbols are referenced.
Specifically, Find Usages displays all usages of a symbol (method, property, local variable etc.) in the Find Results tool window where you can group them, navigate between them, and open in the code view area.
There's also Find Usages Advanced, which is a more detailed version of Find Usages that helps you fine-tune search criteria by limiting the scope of search and other characteristics.
Finally, Highlight Usages in File puts highlighting on usages of a symbol in the current file, depending on whether it's a write or read usage:
Whenever you put a caret on a symbol in the code view area, dotPeek offers a plethora of contextual navigation options that are all available via Navigate To drop-down menu:
For example, Go to Declaration takes you from a usage of any symbol to its declaration. If the symbol is declared on another assembly, the assembly is loaded automatically.
Go to Implementation helps navigate to end implementations of types and type members, bypassing intermediate inheritance steps in the inheritance chain, such as abstract classes.
If there are lines of decompiled code that you feel are important and you want to go back to them later, feel free to set bookmarks:
Explore current class
Use Go to File Member for a quick overview of and navigation to members of a file representing a decompiled type. Enter parts of member names, and navigate directly to them:
Alternatively, if you'd like a static display of members in the current file, open and dock the File Structure tool window:
Perfect for ReSharper users
Actually, if you have experience working with other intelligent developer tools from JetBrains, you'll be able to apply your habits as well.
Jump to a type, symbol or anything
dotPeek indexes all assemblies in your assembly list, as well as all assemblies that they reference, and provides two ReSharper-based features to quickly jump to specific code from this aggregation:
- Go to Symbol helps navigate to a specific symbol declaration, which could be a type, method, field, or property. You can use lowerCamelHumps syntax to locate types — for example, entering xmard is enough to locate and open XamlMarkupDeclaredElement.
- Go to Everything allows searching for an assembly, namespace, type or member from the same input box, and also viewing recently opened files. lowerCamelHumps syntax is supported here as well.
Visual Studio debugger support
dotPeek can perform as a symbol server and supply Visual Studio debugger with the information required to debug assembly code. This can be useful for debugging a project that references an assembly from an external class library. dotPeek listens for requests from Visual Studio debugger, generates PDB files and source files for the requested assemblies on demand, and returns them back to the debugger.
Overview of inheritance chains
If you're interested to navigate up and down the inheritance hierarchy from a specific type or type member, you can always lean on two contextual navigation options: Go to Base Symbols and Go to Derived Symbols.
These are extremely useful when you want to go to an inheritor or a base symbol right away.
However, if you're looking to get a visual overview of a certain inheritance chain, use Type Hierarchy instead: dotPeek will show you all types that are inherited from the selected type, as well as types that it inherits itself — as a tree view, in a separate tool window:
Show compiler-generated code
You can choose to turn off certain compiler transformations, thus making code structure that dotPeek displays very similar to what the compiler turns it to. This helps see how compiler deals with lambdas, closures, and auto-properties, among other things.
Complete keyboard support
dotPeek is a keyboard-centric application, providing keyboard shortcuts for most actions.
By default, dotPeek uses the Visual Studio keymap derived from ReSharper. dotPeek also provides another shortcut scheme familiar to ReSharper users: the IntelliJ IDEA scheme. You can switch between these schemes via Tools | Options | Environment | General.