{toc}
h3. What is dotPeek
dotPeek is a free .NET decompiler and assembly browser from [JetBrains|http://www.jetbrains.com], the makers of [ReSharper|http://www.jetbrains.com/resharper], [dotTrace|http://www.jetbrains.com/profiler], and [dotCover|http://www.jetbrains.com/dotcover] for .NET developers, as well as [a family of IDEs|http://www.jetbrains.com/webide/] for Java, Ruby, Python, PHP, and other languages, plus team development tools: [TeamCity|http://www.jetbrains.com/teamcity] for continuous integration and build management and [YouTrack|http://www.jetbrains.com/youtrack] for issue tracking.
The main idea behind dotPeek is to *make high-quality decompiling coupled with powerful ReSharper-like navigation and search features available to everyone in the .NET community, free of charge*.
!splash.png|border=1!
dotPeek has gone public for the first time in May 2011 as JetBrains opened an [Early Access Program (EAP)|dotPeek Early Access Program] that implied regular publishing of pre-release builds. dotPeek 1.0 has been officially released on May 10, 2012. The latest official version of the decompiler and assembly browser is always available at [http://www.jetbrains.com/decompiler]
JetBrains is also providing decompiling functionality as part of [ReSharper|http://www.jetbrains.com/resharper], the renowned productivity tool for Visual Studio.
{anchor:distribution}
h3. Distribution Options
dotPeek is [available for download|http://www.jetbrains.com/decompiler] in two distributions: an *.msi installer* and a *.zip archive*.
The installer-based distribution is a safe bet if you want to use dotPeek on a single PC and take advantage of automatic version management.
The .zip distribution is a better fit if you prefer to share dotPeek between multiple machines - for example, using a Dropbox folder.
Both distributions are functionally equivalent except for the way you configure [Windows Explorer integration|#windows-explorer].
h3. General Features
For all features described below, default keyboard shortcuts are specified. By default, dotPeek uses the Visual Studio shortcut scheme derived from ReSharper. dotPeek also provides another shortcut scheme familiar to ReSharper users - that is, the IntelliJ IDEA scheme. You can switch between those schemes under _Tools > Options > Environment > General_.
All shortcuts defined in both Visual Studio and IntelliJ IDEA shortcut schemes are listed in a document called [dotPeek Keyboard Shortcuts] that is available from dotPeek via _Help > Keyboard Shortcuts_.
h4. Opening and Browsing Files
dotPeek *decompiles any .NET assemblies and presents them as C# code*.
*Supported file types* include:
* Libraries (_.dll_)
* Executable files (_.exe_)
* Windows 8 metadata files (_.winmd_)
* Archives (_.zip_)
* NuGet packages (_.nupkg_)
* Microsoft Visual Studio Extensions packages (_.vsix_)
Files can be opened in one of the following ways:
* Using the _File > Open_ command.
* Via drag-and-drop of a file (or a selection of files) to dotPeek window.
* For _.dll_ files: By double-clicking a file in Windows Explorer (provided that [Windows Explorer integration|#windows_explorer] is configured.)
* For _.dll_ and _.exe_ files: By right-clicking a file in Windows Explorer and selecting _Browse with JetBrains dotPeek_.
You can also *load entire folders* in the _Assembly Explorer_ by choosing _File > Explore Folder_. When you ask dotPeek to explore a folder, it processes all its subfolders in hunt for files that it is able to decompile, and displays the folder's hierarchy in the _Assembly Explorer_.
!folder.png|thumbnail,border=1!
{note}
Since dotPeek processes a selected folder recursively, make sure to act wise selecting one. You wouldn't really want to explore the entire _Program Files_ folder since it would take a really long time to load all assemblies that it contains in dotPeek.
{note}
*Assemblies from Global Assembly Cache* can be opened via _File > Open from GAC_. One thing to note about the _Open from GAC_ dialog is that you can batch-select assembly items there, and you can also filter out assemblies by entering their *CamelHumps* \- the capitals that different parts of assembly names start with. For example, to find all assemblies with names containing _Microsoft.VisualStudio.Modeling_ in the list of GAC assemblies, you can type _mvsm_:
!open_from_gac.png|thumbnail,border=1!
CamelHumps support is an important concept that also spans multiple [navigation features|#context-insensitive_navigation] of dotPeek that are highlighted below.
dotPeek provides the _Assembly Explorer_ to *traverse the list of opened assemblies*. Expanding an assembly node lists namespaces within the assembly that can be further expanded to types and type members, as well as assembly references.
In addition, the _Assembly Explorer_ contains nodes representing base types and inheritors of the current type. This is a way to browse type inheritance trees that developers with Reflector background usually find appealing. However, dotPeek also provides a bunch of [ReSharper-inspired navigation features|#context-sensitive_navigation] that work not only from the _Assembly Explorer_ but from other tool windows and from the source code view areas as well.
Note that the _Assembly Explorer_ uses the same set of icons that are used in Visual Studio for member identification.
!assembly_explorer.png|thumbnail,border=1!
Pressing _F4_ on an entry in the _Assembly Explorer_ brings up the _Properties_ tool window that shows *basic information about a selected assembly* or reference, such as assembly location, full name, and platform version.
!properties.png|thumbnail,border=1!
Double-clicking a reference loads the referenced assembly, if immediately available. Double-clicking a type or type member displays decompiled code in the source code view area.
Double-clicking an entry under the _Resources_ folder opens the source representation of the corresponding resource in the source code view area (this, for example, applies to _.resources_ files that are converted back to human-readable _.resx_ form, as well as _.png_ and _.bmp_ image formats), or passes it to an external application.
h5. Assembly Lists and Folders
To apply order to the way you work with multiple assemblies, and also to support switching between different sets of assemblies, dotPeek provides assembly lists. You can now work with different assembly lists depending on your context. You can save and reopen assembly lists, or clear the current list if you no longer need it.
!file_open.png|thumbnail,border=1!
Assembly lists are not limited to _.dll_ and _.exe_ files: they can contain all supported file types (including archives) and folders.
{anchor:windows_explorer}
h5. Windows Explorer Integration
If you want to be able to open assemblies in dotPeek by double-clicking them or using the Windows Explorer context menu, you need to enable Windows Explorer integration.
This is accomplished in two different ways depending on the type of [dotPeek distribution|#distribution] that you're using.
If you're deploying dotPeek using the installer, Windows Explorer integration is set using the installation wizard.
However, if you're using the zip distribution, you need to choose _Tools > Options_, and select _Integrate with Windows Explorer_ under _Environment > General_ to enable Windows Explorer integration.
h4. Viewing the Source Code
Source code that dotPeek decompiles is presented as C#. The _source code view area_ has the *look-and-feel of editor tabs in Visual Studio*, with line numbers, options for word wrap and outlining, white space marks, and tabs to open different types in. To set outlining options, set of switch off word wrap and tweak other source code view area options to your liking, consider playing with menu items available through _View > Outlining_ and _View > Options_. You might also want to glance through _Tools > Options_.
*Code syntax is highlighted* ReSharper-style, with distinctive colors for properties, types, accessors, and methods.
When you put the caret on a delimiter, be it a brace or, say, parenthesis, it gets highlighted along with its counterpart, bringing focus to the scope of the particular code block you're in:
!source_code_view.png|thumbnail,border=1!
Similar to ReSharper, you can choose to *highlight matching delimiters* with a color. This and other ReSharper-style source code view area options can be set via _Tools > Options > Environment Editor_.
Another noticeable ReSharper-like feature gets handy when you want to select a part of decompiled code, and is called _Extend/Shrink Selection_. Using a dedicated shortcut (by default, _Ctrl+Alt+Right_) lets you *successively select expanding blocks of code*, starting from a substring of a symbol, on to a statement, line, code block, and all the way to the entire code file. A pair shortcut (_Ctrl+Alt+Left_) works the opposite way, successively narrowing a selection. [Read more|http://blogs.jetbrains.com/dotnet/2008/01/extendshrink-selection/] about this functionality as it is implemented in ReSharper.
When you explore decompiled code, you may be willing to learn more about referenced types and method calls without opening their declarations. Two coding assistance features from ReSharper will help you with that:
* _Edit > Parameter Information_ (_Ctrl+P_) on a method call will *display all available signatures* of a given method.
* _Edit > Show Quick Documentation_ (_Ctrl+Shift+F1_) on a usage of a type, method, property, or another type member will display an *overview of its documentation comments*:
!quickdoc.png|thumbnail,border=1!
Using the _Show compiler-generated code_ switch on the dotPeek toolbar, 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.
!show_compiler_generated_code.png|thumbnail,border=1!
h3. Navigation and Search
The primary idea behind dotPeek is to bring ReSharper experience to browsing external assemblies and make this available to everyone. The main thing that distinguishes dotPeek from other decompilers around is that *the majority of [ReSharper navigation features|http://www.jetbrains.com/resharper/features/navigation_search.html] are available in dotPeek* as well. Let's take a closer look at those:
{anchor:context-insensitive_navigation}
h4. Context-Insensitive Navigation in Decompiled Code
When you're loading an assembly and you don't know what you're looking for and you want to find out how things are organized within the assembly, you start off with the _Assembly Explorer_ and you probably proceed by navigating between symbol declarations in the code view area.
However, you go a different path if you know exactly (or even approximately) which part of the assembly you need to look at - in this case, you can use one of ReSharper's "go to" context-insensitive navigation features:
h5. Navigating to a Type
Use _Navigate > Go to Type_ (_Ctrl+T_) to *navigate to a specific class or interface*. You type in the name of the type you want to find, and dotPeek searches for a match within all loaded assemblies. Here again, the concept of CamelHumps is applicable - you don't need to type _DatasetMethodGenerator_ to open this class - typing _dmg_ is enough:
!go_to_type.png|thumbnail,border=1!
h5. Navigating to a Specific Symbol
Use _Navigate > Go to Symbol_ (_Shift+Alt+T_) to *navigate to a specific symbol declaration*, which could be a type, method, field, or property. Again, use CamelHumps to narrow down the list of symbols that dotPeek presents:
!go_to_symbol.png|thumbnail,border=1!
Since the number of symbols is greatly higher than that of types, and there can possibly be multiple symbols with the same name, you may want to spend a little more time investigating the list of results. One way to do that is press the plus sign (_Show in Find Results_) while dotPeek shows symbols in the _Go to Symbol_ drop-down list - this will allow you to flush all found results to the _Find Results_ tool window where you can take your time to investigate the results, group based on different criteria, copy to clipboard or export to a file.
!find_results.png|thumbnail,border=1!
h5. Navigating Between File Members
As soon as you've opened a specific type, use _Navigate > Go to File Member_ (_Alt+Backslash_) for a *quick overview of and navigation to members in this file*.
!go_to_file_member.png|thumbnail,border=1!
Alternatively, you can open the _File Structure_ tool window (_Windows > File Structure_, or _Ctrl+Alt+F_) for a static display of members in the current file.
!file_structure.png|thumbnail,border=1!
_File Structure_ provides additional file browsing capabilities: for example, if you set _Automatically scroll to source_ in _File Structure_ toolbar, every time you select a member in _File Structure_, the code view area scrolls to the declaration of this member.
The _Track caret in editor_ option works the opposite way: as you move the caret within the code view area, the corresponding member is highlighted in _File Structure_.
You can learn more about _File Structure_ options in [ReSharper web help|http://www.jetbrains.com/resharper/webhelp/Reference__Windows__File_Structure_Window.html].
h5. Navigating to a Code File or Assembly
dotPeek also provides _Go to File_ (_Navigate > Go to File_ or _Ctrl+Shift+T_) to quickly open files and folders, and assemblies. There are two use cases for this feature:
* You can navigate to a specific loaded assembly that gets highlighted in the _Assembly Explorer_.
* You can use it as an extended tab switcher that not only works with currently opened code files but also takes into account any tabs that you've opened during the current dotPeek session.
Speaking of previously opened files, if you've recently closed a code file but you need to have it open again, there's an easy way to have it back: just choose _Navigate > Recent Files_ (_Ctrl+,_) and in the resulting drop-down list, pick the file you're looking for:
!recent_files.png|thumbnail,border=1!
{anchor:context-sensitive_navigation}
h4. Context-Sensitive Navigation Between Symbols in Decompiled Code
dotPeek provides the same level of insight in context-sensitive navigation between decompiled code symbols as ReSharper does for source code. You *navigate to symbol declarations, implementations, derived and base symbols, and any other applicable destinations* just like you would in Visual Studio with ReSharper enabled.
Specifically, when you've landed the caret on a symbol, you can always get an overview of all possible navigation targets using the _Navigate To_ drop-down menu (_Navigate > Navigate To_ or _Alt+`_):
!navigate_to.png|thumbnail,border=1!
The majority of navigation destinations presented in the _Navigate To_ drop-down menu are also available directly through the top-level _Navigate_ menu.
The following context-sensitive navigation commands can be available depending on context:
* _Go to Declaration_ (_F12_): this takes you *from a usage of any symbol to its declaration*. Should the symbol be dependent on another assembly, the assembly will be loaded silently, if available.
* _Go to Base Symbols_ (_Alt+Home_): this takes you to corresponding symbols *upwards the inheritance hierarchy*:
!go_to_base.png|thumbnail,border=1!
* _Go to Derived Symbols_ (_Alt+End_): the opposite of _base symbols_, this command lets you go *to any of implementing/overriding members or implementing/derived types*:
!go_to_derived.png|thumbnail,border=1!
* _Go to Implementation_ (_Ctrl+F12_): allowing navigating *to end implementations of types and type members*, bypassing intermediate inheritance steps in the inheritance chain, such as abstract classes.
* _Go to Extension Methods_ (only available through _Navigate To_): shows *all extension methods* for a certain type.
* _Go to Sources from Symbol Files_ (only available through _Navigate To_): *download symbol information from a source server* and recreate source code. (See below for more information.)
* _Go to Assembly Explorer_ (only available through _Navigate To_): navigates from a type or type member in source code view *to the corresponding node in the _Assembly Explorer_*. Interestingly, this command is duplicated by another shortcut, _Shift+Alt+L_, that, when applied in ReSharper, locates the currently open file in the Solution Explorer.
For more details on these and other special-purpose commands available through the _Navigate To_ drop-down menu, see [ReSharper web help|http://www.jetbrains.com/resharper/webhelp/Navigation_and_Search__Navigate_from_Here.html].
h4. Searching in Decompiled Code
dotPeek offers the same capabilities of searching for items in decompiled code as ReSharper offers in source code inside Visual Studio. Here's the list of features serving to find all references to a certain symbol:
* _Navigate > Find Usages_ (_Shift+F12_): This finds *all usages of a symbol* (method, property, local variable etc.) from its any occurrence, be it a declaration or one of its usages. You can invoke this command from the code view area, from the _Assembly Explorer_, or any other tool window. If more than a single usage is found, all usages are fetched to the _Find Results_ tool window where you can group them in different ways, navigate between them, and open in the code view area. You can [learn more about Find Usages|http://www.jetbrains.com/resharper/features/navigation_search.html#Find_Usages] on ReSharper web site.
!findusages.png|thumbnail,border=1!
* _Navigate > Usages of Symbol_ (_Shift+Alt+F12_): This is a modification on _Find Usages_ that shows a pop-up with all found usages instead of flushing them to _Find Results_. This is handy when you have a limited set of usages from which you can quickly pick the one you need. It is also available via the _Navigate To_ drop-down menu.
!usagesofsymbol.png|thumbnail,border=1!
* _Navigate > Find Usages Advanced_ (_Ctrl+Shift+Alt+F12_): This is a zoomed-in version of _Find Usages_ that allows you to *fine-tune search criteria* by limiting the scope of search and other characteristics.
h3. Other Features
h4. Type Hierarchy
We've already covered _Go to Derived Symbols_ and _Go to Base Symbols_ above but these two features are useful when you want to go to an inheritor or a base symbol right away. What if you're looking to plainly *get an overview of a certain inheritance chain*? That's where the _Type Hierarchy_ view comes handy: press _Ctrl+Alt+H_ on a usage of any type, and dotPeek will show you all types that are inherited from it, as well as types that it inherits itself - as a tree view, in a separate tool window.
!type_hierarchy.png|thumbnail,border=1!
Goodness doesn't end here, though: you can select nodes in the tool window, rebase hierarchies on them; show or hide previews of type members; and switch between several hierarchy views: for example, you can opt to only show subtypes or supertypes of a given type.
h4. Reference Hierarchy
A derivative of _Type Hierarchy_ introduced above, the _Reference Hierarchy_ tool window shows which references the current assembly has, allowing you to *track down all assembly dependencies*, and additionally showing recursive dependencies with a glyph to the right of a reference entry.
If you click _Referencing projects_ in the tool window’s toolbar, you can see which of the assemblies in your current assembly list reference the current selected assembly.
!reference_hierarchy.png|thumbnail,border=1!
h4. Downloading Source Code from Source Servers
Decompiled code is better than nothing (especially if it's decompiled with dotPeek) but sometimes you want to explore an assembly exactly the way it had been originally written, and be able to read comments its developers have made. Sometimes dotPeek can help with that: it is able to *get symbol information and recreate source code* from [Microsoft Reference Source Center|http://referencesource.microsoft.com/] and [SymbolSource.org|http://www.symbolsource.org/]. You can try calling _Navigate > Navigate To > Sources from Symbol Files_ on a type or member and see if symbol information for this particular assembly is available. You can even go as far as make downloading symbol files the default action for _Go to declaration_ - to do that go to _Tools > Options > Decompiler_ and select _Allow downloading from remote locations_.
!navigation_dropdown.png|thumbnail,border=1!
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.
h4. Keyboard-Driven Navigation Between Tool Windows
In the best traditions of JetBrains tools, you rarely need to use a mouse when working with dotPeek: switching between the _Assembly Explorer_ and the code view area; opening _File Structure_, _Find Results_, _Type Hierarchy_ and other tool windows doesn't require mouse clicks: every tool window is assigned a shortcut of its own (see the _Windows_ menu for shortcut hints), and getting back to the code view area is as easy as pressing _Esc_.
h4. Customizable, Rich Tool Windows
When it comes to customizing your workspace within dotPeek, you do need the mouse but otherwise, it's plain easy and familiar. Tool windows behave the same way they do in Visual Studio: they can be left floating or docked in multiple positions. _Find Results_ and _Type Hierarchy_ support multiple tabs, allowing you to have several sets of search results or hierarchies open at the same time, and _File Structure_ content can be filtered to only display results that match a search string:
!file_structure_filtered.png|thumbnail,border=1!
h3. What's Next
As dotPeek 1.0 has been successfully released in May 2012, we're now looking to come up with a bug fix release in coming months, and then proceed to implementing [your feature requests|http://bit.ly/MkDmOz].
Thanks for reading up until this point! We hope you've had much fun playing with dotPeek.
In case you were just looking around trying to find out if the tool was worth it, now it's probably the right time to [download the latest and greatest dotPeek|http://www.jetbrains.com/decompiler/download] and see with your own eyes.
h3. What is dotPeek
dotPeek is a free .NET decompiler and assembly browser from [JetBrains|http://www.jetbrains.com], the makers of [ReSharper|http://www.jetbrains.com/resharper], [dotTrace|http://www.jetbrains.com/profiler], and [dotCover|http://www.jetbrains.com/dotcover] for .NET developers, as well as [a family of IDEs|http://www.jetbrains.com/webide/] for Java, Ruby, Python, PHP, and other languages, plus team development tools: [TeamCity|http://www.jetbrains.com/teamcity] for continuous integration and build management and [YouTrack|http://www.jetbrains.com/youtrack] for issue tracking.
The main idea behind dotPeek is to *make high-quality decompiling coupled with powerful ReSharper-like navigation and search features available to everyone in the .NET community, free of charge*.
!splash.png|border=1!
dotPeek has gone public for the first time in May 2011 as JetBrains opened an [Early Access Program (EAP)|dotPeek Early Access Program] that implied regular publishing of pre-release builds. dotPeek 1.0 has been officially released on May 10, 2012. The latest official version of the decompiler and assembly browser is always available at [http://www.jetbrains.com/decompiler]
JetBrains is also providing decompiling functionality as part of [ReSharper|http://www.jetbrains.com/resharper], the renowned productivity tool for Visual Studio.
{anchor:distribution}
h3. Distribution Options
dotPeek is [available for download|http://www.jetbrains.com/decompiler] in two distributions: an *.msi installer* and a *.zip archive*.
The installer-based distribution is a safe bet if you want to use dotPeek on a single PC and take advantage of automatic version management.
The .zip distribution is a better fit if you prefer to share dotPeek between multiple machines - for example, using a Dropbox folder.
Both distributions are functionally equivalent except for the way you configure [Windows Explorer integration|#windows-explorer].
h3. General Features
For all features described below, default keyboard shortcuts are specified. By default, dotPeek uses the Visual Studio shortcut scheme derived from ReSharper. dotPeek also provides another shortcut scheme familiar to ReSharper users - that is, the IntelliJ IDEA scheme. You can switch between those schemes under _Tools > Options > Environment > General_.
All shortcuts defined in both Visual Studio and IntelliJ IDEA shortcut schemes are listed in a document called [dotPeek Keyboard Shortcuts] that is available from dotPeek via _Help > Keyboard Shortcuts_.
h4. Opening and Browsing Files
dotPeek *decompiles any .NET assemblies and presents them as C# code*.
*Supported file types* include:
* Libraries (_.dll_)
* Executable files (_.exe_)
* Windows 8 metadata files (_.winmd_)
* Archives (_.zip_)
* NuGet packages (_.nupkg_)
* Microsoft Visual Studio Extensions packages (_.vsix_)
Files can be opened in one of the following ways:
* Using the _File > Open_ command.
* Via drag-and-drop of a file (or a selection of files) to dotPeek window.
* For _.dll_ files: By double-clicking a file in Windows Explorer (provided that [Windows Explorer integration|#windows_explorer] is configured.)
* For _.dll_ and _.exe_ files: By right-clicking a file in Windows Explorer and selecting _Browse with JetBrains dotPeek_.
You can also *load entire folders* in the _Assembly Explorer_ by choosing _File > Explore Folder_. When you ask dotPeek to explore a folder, it processes all its subfolders in hunt for files that it is able to decompile, and displays the folder's hierarchy in the _Assembly Explorer_.
!folder.png|thumbnail,border=1!
{note}
Since dotPeek processes a selected folder recursively, make sure to act wise selecting one. You wouldn't really want to explore the entire _Program Files_ folder since it would take a really long time to load all assemblies that it contains in dotPeek.
{note}
*Assemblies from Global Assembly Cache* can be opened via _File > Open from GAC_. One thing to note about the _Open from GAC_ dialog is that you can batch-select assembly items there, and you can also filter out assemblies by entering their *CamelHumps* \- the capitals that different parts of assembly names start with. For example, to find all assemblies with names containing _Microsoft.VisualStudio.Modeling_ in the list of GAC assemblies, you can type _mvsm_:
!open_from_gac.png|thumbnail,border=1!
CamelHumps support is an important concept that also spans multiple [navigation features|#context-insensitive_navigation] of dotPeek that are highlighted below.
dotPeek provides the _Assembly Explorer_ to *traverse the list of opened assemblies*. Expanding an assembly node lists namespaces within the assembly that can be further expanded to types and type members, as well as assembly references.
In addition, the _Assembly Explorer_ contains nodes representing base types and inheritors of the current type. This is a way to browse type inheritance trees that developers with Reflector background usually find appealing. However, dotPeek also provides a bunch of [ReSharper-inspired navigation features|#context-sensitive_navigation] that work not only from the _Assembly Explorer_ but from other tool windows and from the source code view areas as well.
Note that the _Assembly Explorer_ uses the same set of icons that are used in Visual Studio for member identification.
!assembly_explorer.png|thumbnail,border=1!
Pressing _F4_ on an entry in the _Assembly Explorer_ brings up the _Properties_ tool window that shows *basic information about a selected assembly* or reference, such as assembly location, full name, and platform version.
!properties.png|thumbnail,border=1!
Double-clicking a reference loads the referenced assembly, if immediately available. Double-clicking a type or type member displays decompiled code in the source code view area.
Double-clicking an entry under the _Resources_ folder opens the source representation of the corresponding resource in the source code view area (this, for example, applies to _.resources_ files that are converted back to human-readable _.resx_ form, as well as _.png_ and _.bmp_ image formats), or passes it to an external application.
h5. Assembly Lists and Folders
To apply order to the way you work with multiple assemblies, and also to support switching between different sets of assemblies, dotPeek provides assembly lists. You can now work with different assembly lists depending on your context. You can save and reopen assembly lists, or clear the current list if you no longer need it.
!file_open.png|thumbnail,border=1!
Assembly lists are not limited to _.dll_ and _.exe_ files: they can contain all supported file types (including archives) and folders.
{anchor:windows_explorer}
h5. Windows Explorer Integration
If you want to be able to open assemblies in dotPeek by double-clicking them or using the Windows Explorer context menu, you need to enable Windows Explorer integration.
This is accomplished in two different ways depending on the type of [dotPeek distribution|#distribution] that you're using.
If you're deploying dotPeek using the installer, Windows Explorer integration is set using the installation wizard.
However, if you're using the zip distribution, you need to choose _Tools > Options_, and select _Integrate with Windows Explorer_ under _Environment > General_ to enable Windows Explorer integration.
h4. Viewing the Source Code
Source code that dotPeek decompiles is presented as C#. The _source code view area_ has the *look-and-feel of editor tabs in Visual Studio*, with line numbers, options for word wrap and outlining, white space marks, and tabs to open different types in. To set outlining options, set of switch off word wrap and tweak other source code view area options to your liking, consider playing with menu items available through _View > Outlining_ and _View > Options_. You might also want to glance through _Tools > Options_.
*Code syntax is highlighted* ReSharper-style, with distinctive colors for properties, types, accessors, and methods.
When you put the caret on a delimiter, be it a brace or, say, parenthesis, it gets highlighted along with its counterpart, bringing focus to the scope of the particular code block you're in:
!source_code_view.png|thumbnail,border=1!
Similar to ReSharper, you can choose to *highlight matching delimiters* with a color. This and other ReSharper-style source code view area options can be set via _Tools > Options > Environment Editor_.
Another noticeable ReSharper-like feature gets handy when you want to select a part of decompiled code, and is called _Extend/Shrink Selection_. Using a dedicated shortcut (by default, _Ctrl+Alt+Right_) lets you *successively select expanding blocks of code*, starting from a substring of a symbol, on to a statement, line, code block, and all the way to the entire code file. A pair shortcut (_Ctrl+Alt+Left_) works the opposite way, successively narrowing a selection. [Read more|http://blogs.jetbrains.com/dotnet/2008/01/extendshrink-selection/] about this functionality as it is implemented in ReSharper.
When you explore decompiled code, you may be willing to learn more about referenced types and method calls without opening their declarations. Two coding assistance features from ReSharper will help you with that:
* _Edit > Parameter Information_ (_Ctrl+P_) on a method call will *display all available signatures* of a given method.
* _Edit > Show Quick Documentation_ (_Ctrl+Shift+F1_) on a usage of a type, method, property, or another type member will display an *overview of its documentation comments*:
!quickdoc.png|thumbnail,border=1!
Using the _Show compiler-generated code_ switch on the dotPeek toolbar, 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.
!show_compiler_generated_code.png|thumbnail,border=1!
h3. Navigation and Search
The primary idea behind dotPeek is to bring ReSharper experience to browsing external assemblies and make this available to everyone. The main thing that distinguishes dotPeek from other decompilers around is that *the majority of [ReSharper navigation features|http://www.jetbrains.com/resharper/features/navigation_search.html] are available in dotPeek* as well. Let's take a closer look at those:
{anchor:context-insensitive_navigation}
h4. Context-Insensitive Navigation in Decompiled Code
When you're loading an assembly and you don't know what you're looking for and you want to find out how things are organized within the assembly, you start off with the _Assembly Explorer_ and you probably proceed by navigating between symbol declarations in the code view area.
However, you go a different path if you know exactly (or even approximately) which part of the assembly you need to look at - in this case, you can use one of ReSharper's "go to" context-insensitive navigation features:
h5. Navigating to a Type
Use _Navigate > Go to Type_ (_Ctrl+T_) to *navigate to a specific class or interface*. You type in the name of the type you want to find, and dotPeek searches for a match within all loaded assemblies. Here again, the concept of CamelHumps is applicable - you don't need to type _DatasetMethodGenerator_ to open this class - typing _dmg_ is enough:
!go_to_type.png|thumbnail,border=1!
h5. Navigating to a Specific Symbol
Use _Navigate > Go to Symbol_ (_Shift+Alt+T_) to *navigate to a specific symbol declaration*, which could be a type, method, field, or property. Again, use CamelHumps to narrow down the list of symbols that dotPeek presents:
!go_to_symbol.png|thumbnail,border=1!
Since the number of symbols is greatly higher than that of types, and there can possibly be multiple symbols with the same name, you may want to spend a little more time investigating the list of results. One way to do that is press the plus sign (_Show in Find Results_) while dotPeek shows symbols in the _Go to Symbol_ drop-down list - this will allow you to flush all found results to the _Find Results_ tool window where you can take your time to investigate the results, group based on different criteria, copy to clipboard or export to a file.
!find_results.png|thumbnail,border=1!
h5. Navigating Between File Members
As soon as you've opened a specific type, use _Navigate > Go to File Member_ (_Alt+Backslash_) for a *quick overview of and navigation to members in this file*.
!go_to_file_member.png|thumbnail,border=1!
Alternatively, you can open the _File Structure_ tool window (_Windows > File Structure_, or _Ctrl+Alt+F_) for a static display of members in the current file.
!file_structure.png|thumbnail,border=1!
_File Structure_ provides additional file browsing capabilities: for example, if you set _Automatically scroll to source_ in _File Structure_ toolbar, every time you select a member in _File Structure_, the code view area scrolls to the declaration of this member.
The _Track caret in editor_ option works the opposite way: as you move the caret within the code view area, the corresponding member is highlighted in _File Structure_.
You can learn more about _File Structure_ options in [ReSharper web help|http://www.jetbrains.com/resharper/webhelp/Reference__Windows__File_Structure_Window.html].
h5. Navigating to a Code File or Assembly
dotPeek also provides _Go to File_ (_Navigate > Go to File_ or _Ctrl+Shift+T_) to quickly open files and folders, and assemblies. There are two use cases for this feature:
* You can navigate to a specific loaded assembly that gets highlighted in the _Assembly Explorer_.
* You can use it as an extended tab switcher that not only works with currently opened code files but also takes into account any tabs that you've opened during the current dotPeek session.
Speaking of previously opened files, if you've recently closed a code file but you need to have it open again, there's an easy way to have it back: just choose _Navigate > Recent Files_ (_Ctrl+,_) and in the resulting drop-down list, pick the file you're looking for:
!recent_files.png|thumbnail,border=1!
{anchor:context-sensitive_navigation}
h4. Context-Sensitive Navigation Between Symbols in Decompiled Code
dotPeek provides the same level of insight in context-sensitive navigation between decompiled code symbols as ReSharper does for source code. You *navigate to symbol declarations, implementations, derived and base symbols, and any other applicable destinations* just like you would in Visual Studio with ReSharper enabled.
Specifically, when you've landed the caret on a symbol, you can always get an overview of all possible navigation targets using the _Navigate To_ drop-down menu (_Navigate > Navigate To_ or _Alt+`_):
!navigate_to.png|thumbnail,border=1!
The majority of navigation destinations presented in the _Navigate To_ drop-down menu are also available directly through the top-level _Navigate_ menu.
The following context-sensitive navigation commands can be available depending on context:
* _Go to Declaration_ (_F12_): this takes you *from a usage of any symbol to its declaration*. Should the symbol be dependent on another assembly, the assembly will be loaded silently, if available.
* _Go to Base Symbols_ (_Alt+Home_): this takes you to corresponding symbols *upwards the inheritance hierarchy*:
!go_to_base.png|thumbnail,border=1!
* _Go to Derived Symbols_ (_Alt+End_): the opposite of _base symbols_, this command lets you go *to any of implementing/overriding members or implementing/derived types*:
!go_to_derived.png|thumbnail,border=1!
* _Go to Implementation_ (_Ctrl+F12_): allowing navigating *to end implementations of types and type members*, bypassing intermediate inheritance steps in the inheritance chain, such as abstract classes.
* _Go to Extension Methods_ (only available through _Navigate To_): shows *all extension methods* for a certain type.
* _Go to Sources from Symbol Files_ (only available through _Navigate To_): *download symbol information from a source server* and recreate source code. (See below for more information.)
* _Go to Assembly Explorer_ (only available through _Navigate To_): navigates from a type or type member in source code view *to the corresponding node in the _Assembly Explorer_*. Interestingly, this command is duplicated by another shortcut, _Shift+Alt+L_, that, when applied in ReSharper, locates the currently open file in the Solution Explorer.
For more details on these and other special-purpose commands available through the _Navigate To_ drop-down menu, see [ReSharper web help|http://www.jetbrains.com/resharper/webhelp/Navigation_and_Search__Navigate_from_Here.html].
h4. Searching in Decompiled Code
dotPeek offers the same capabilities of searching for items in decompiled code as ReSharper offers in source code inside Visual Studio. Here's the list of features serving to find all references to a certain symbol:
* _Navigate > Find Usages_ (_Shift+F12_): This finds *all usages of a symbol* (method, property, local variable etc.) from its any occurrence, be it a declaration or one of its usages. You can invoke this command from the code view area, from the _Assembly Explorer_, or any other tool window. If more than a single usage is found, all usages are fetched to the _Find Results_ tool window where you can group them in different ways, navigate between them, and open in the code view area. You can [learn more about Find Usages|http://www.jetbrains.com/resharper/features/navigation_search.html#Find_Usages] on ReSharper web site.
!findusages.png|thumbnail,border=1!
* _Navigate > Usages of Symbol_ (_Shift+Alt+F12_): This is a modification on _Find Usages_ that shows a pop-up with all found usages instead of flushing them to _Find Results_. This is handy when you have a limited set of usages from which you can quickly pick the one you need. It is also available via the _Navigate To_ drop-down menu.
!usagesofsymbol.png|thumbnail,border=1!
* _Navigate > Find Usages Advanced_ (_Ctrl+Shift+Alt+F12_): This is a zoomed-in version of _Find Usages_ that allows you to *fine-tune search criteria* by limiting the scope of search and other characteristics.
h3. Other Features
h4. Type Hierarchy
We've already covered _Go to Derived Symbols_ and _Go to Base Symbols_ above but these two features are useful when you want to go to an inheritor or a base symbol right away. What if you're looking to plainly *get an overview of a certain inheritance chain*? That's where the _Type Hierarchy_ view comes handy: press _Ctrl+Alt+H_ on a usage of any type, and dotPeek will show you all types that are inherited from it, as well as types that it inherits itself - as a tree view, in a separate tool window.
!type_hierarchy.png|thumbnail,border=1!
Goodness doesn't end here, though: you can select nodes in the tool window, rebase hierarchies on them; show or hide previews of type members; and switch between several hierarchy views: for example, you can opt to only show subtypes or supertypes of a given type.
h4. Reference Hierarchy
A derivative of _Type Hierarchy_ introduced above, the _Reference Hierarchy_ tool window shows which references the current assembly has, allowing you to *track down all assembly dependencies*, and additionally showing recursive dependencies with a glyph to the right of a reference entry.
If you click _Referencing projects_ in the tool window’s toolbar, you can see which of the assemblies in your current assembly list reference the current selected assembly.
!reference_hierarchy.png|thumbnail,border=1!
h4. Downloading Source Code from Source Servers
Decompiled code is better than nothing (especially if it's decompiled with dotPeek) but sometimes you want to explore an assembly exactly the way it had been originally written, and be able to read comments its developers have made. Sometimes dotPeek can help with that: it is able to *get symbol information and recreate source code* from [Microsoft Reference Source Center|http://referencesource.microsoft.com/] and [SymbolSource.org|http://www.symbolsource.org/]. You can try calling _Navigate > Navigate To > Sources from Symbol Files_ on a type or member and see if symbol information for this particular assembly is available. You can even go as far as make downloading symbol files the default action for _Go to declaration_ - to do that go to _Tools > Options > Decompiler_ and select _Allow downloading from remote locations_.
!navigation_dropdown.png|thumbnail,border=1!
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.
h4. Keyboard-Driven Navigation Between Tool Windows
In the best traditions of JetBrains tools, you rarely need to use a mouse when working with dotPeek: switching between the _Assembly Explorer_ and the code view area; opening _File Structure_, _Find Results_, _Type Hierarchy_ and other tool windows doesn't require mouse clicks: every tool window is assigned a shortcut of its own (see the _Windows_ menu for shortcut hints), and getting back to the code view area is as easy as pressing _Esc_.
h4. Customizable, Rich Tool Windows
When it comes to customizing your workspace within dotPeek, you do need the mouse but otherwise, it's plain easy and familiar. Tool windows behave the same way they do in Visual Studio: they can be left floating or docked in multiple positions. _Find Results_ and _Type Hierarchy_ support multiple tabs, allowing you to have several sets of search results or hierarchies open at the same time, and _File Structure_ content can be filtered to only display results that match a search string:
!file_structure_filtered.png|thumbnail,border=1!
h3. What's Next
As dotPeek 1.0 has been successfully released in May 2012, we're now looking to come up with a bug fix release in coming months, and then proceed to implementing [your feature requests|http://bit.ly/MkDmOz].
Thanks for reading up until this point! We hope you've had much fun playing with dotPeek.
In case you were just looking around trying to find out if the tool was worth it, now it's probably the right time to [download the latest and greatest dotPeek|http://www.jetbrains.com/decompiler/download] and see with your own eyes.