Debugging Sitecore Using DotPeek

Sometimes when I use Sitecore I need to decompile it`s assemblies in order to understand how it works internally. Jumping over it`s complex abstractions I always think of a way to use VS debugging but unfortunately I do not have the required pdb files. Now this problem is solved by JetBrains …

DotPeak is a free .net decompiler by JetBrains. With it`s latest version it brings the option for pdb files generation and using them for debugging assemblies.
Steps to start debugging Sitecore:

    1. Download and install the latest version of dotPeak: https://www.jetbrains.com/decompiler/

 

    1. Open dotPeak and click on StartSymbolServerstartSymbolServerBy default dotPeek uses port 33417 for its symbol server – if you want to change the port go to options/symbol server

 

    1. Open Visual Studio options

 

    1. In Debugging/Symbols tab click on add new symbol files location and enter http://localhost:33417 (or the port that you assigned in the previous step)
      VSoptions

 

    1. In VS options go to Debugging/General and uncheck “Enable Just My Code” option if it is checked
      Now we need to generate the Sitecore pdb files:

 

    1. In dotPeek click on open icon that will show a dialog for loading an assembly
      OpenAssembly

 

    1. After the assembly is loaded right click on it and click generate pdb. In the appeared window choose the namespaces that you need to debug (or each one as I did) and click Generate
      Now we are ready for debugging

 

    1. Open VS and attach to the sitecore process (loading symbols may take longer than usual)

 

  1. You are ready: step into Sitecore.Kernel.dll
    debugging

2 Comments

Leave a Comment.