dotPeek Web Help

Starting from version 1.2, dotPeek can function as a symbol server, that is, it can supply a debugger with the information required to debug compiled assemblies.

In contrast to traditional symbol servers, e.g. Microsoft Symbol Server, dotPeek does not store any symbol files, it generates PDB and source files for the requested assemblies and returns them back to the debugger.

In this topic:

Running dotPeek symbol server

To start/stop dotPeek symbol server
  • Click Start/Stop Symbol Server on the action bar.
  • Choose Tools | Start/Stop Symbol Server on the main menu.

At the first start, dotPeek symbol server you are asked to choose the assemblies you want to generate symbol files for. See Configuring dotPeek Symbol Server below to learn about configuration options.

As soon as dotPeek symbol server is started, the corresponding icon appear in the status bar. You can hover the mouse pointer over it to check its address and the current configuration:

dotPeek symbol server icon in the status bar

To make use of dotPeek symbol server, you can specify its address in your debugger settings. In Microsoft Visual Studio, the configuration is as follows:

To set up Visual Studio for working with dotPeek Symbol Server
  1. Select In the Visual Studio menu, select Tools | Options | Debugging | Symbols.
  2. Click Add new location and specify the following address for it: http://localhost:33417/. (The port number is configurable on the Symbol Server page of dotPeek options).

    Debugging symbols options in Visual Studio

  3. In the Visual Studio options, go to Debugging | General page and clear the Enable Just My Code check box.
  4. If you want to step inside the .NET Framework symbols, tick the Enable .NET Framework source stepping check box.

Configuring dotPeek symbol server

dotPeek symbol server allows you to choose the exact assemblies for which symbol files should be generated. The correct configuration prevents you from undesired stepping into system assemblies or other assemblies that you are not interested in.

To configure dotPeek symbol server
  1. Choose Tools | Options in dotPeek's main menu.
  2. Open the Symbol Server page.
  3. Using the radio buttons, choose one of the options under the Generate symbol files (.pdb) for. The meanings of the first three options are obvious. The last one allows for the most flexibility - after selecting this option, you can choose only those assemblies which you need for debugging, and open them in the Assembly Explorer.
  4. Optionally, you can change the port number that will be used for dotPeek symbol server.
  5. Click OK.

Possible problems and solutions

If something goes wrong with dotPeek symbol server, the first thing you can do is to open the Project/PDB Generation Log window (Windows | Project/PDB Generation Log in dotPeek's menu). Here you can see all symbol server tasks as well as the results of the Generate PDB and the Generate Project commands. If some PDB was requested from dotPeek symbol server by a debugger but was not generated, you will see the corresponding entry with the error message in this window:

  • Most often, problems occur when the target assembly is not found. To fix that, you can open the assembly in the Assembly Explorer. If you don't know the location of the assembly, you can learn it when Visual Studio is in the debug mode - open the Modules window (Debug | Windows | Modules) and check the Path column.
  • If you are running dotPeek on 64-bit Windows, check that you are running the 64-bit version of dotPeek.

If the requested assembly does not appear in the Project/PDB Generation Log window, it means that the debugger has already found the corresponding symbol file and did not requested it from dotPeek. If the symbol file is correct and the source code is available, then everything is fine, the assembly can be debugged without dotPeek. If not, try the following:

  • Delete or rename the PDB file that makes problems. You can always find the actual PDB file location, if any, for each assembly when Visual Studio is in the debug mode - open the Modules window (Debug | Windows | Modules) and check the Symbol File column.
  • If the PDB file is received from another symbol server, you can either disable this server or move the dotPeek symbol server up in the list of symbol servers (Debugging | Symbols | Symbol file locations in the Visual Studio options).

Another problem with debugging compiled assemblies is optimized assemblies. For optimized assemblies, some debugger functions are just not available, e.g. you would not see values of local variables, even if symbol files are correct. You can check if the assembly is optimized when Visual Studio is in the debug mode - open the Modules window (Debug | Windows | Modules) and check the Optimized column.