Skip to content

Debugging issues

Péter Major edited this page Apr 3, 2018 · 3 revisions

This guide is about debugging issues without building the code. This allows to analyze hard to reproduce issues without having the required build environment. If you want to build the code yourself, or want to perform the fix after an analysis, please refer to this.

Preparation

To debug something in .Net you generally need the following:

  • The source code.
  • The application to debug.
  • The debugging symbols.
  • Visual Studio.

It is very important that these three must be for the same version of the application, in fact the debugging symbols (PDB files) must be from the same build of the application (matching the source code is not enough).

Fortunately you can get all of these very easily:

  • Go to releases.
  • Select the version you want to debug.
  • Then download the AxoCover-debug.vsix, and the corresponding Source Code zip.
  • Install the VSIX file, start Visual Studio and verify that the version installed is the same (see the build version at the bottom of Settings / Feedback in AxoCover). Note: if you have a newer version already you must remove it first. You must also ensure that in AxoCover Settings you disable the Install updates automatically in Releases and updates, since it can replace your installed version based on the settings.
  • Extract the PDB files from the VSIX, these establish mapping between the source code and the executable. VSIX are in fact zip files, so you can just rename them to zip and extract, or use 7Zip which recognizes VSIX files even without renaming.
  • Also extract he source code.

Any Visual Studio version which is supported by AxoCover should be fine for debugging too.

Debugging

Now you can perform the actual analysis. This will require running two instances of Visual Studio: one with your own project, where you reproduce the issue, the other will attach to this to debug it.

For the debugging of a Visual Studio instance with AxoCover:

  • Open AxoCover.sln from the extracted source code.
  • Use Debug / Attach to Process... and attach to the other Visual Studio instance (devenv.exe)
  • For the debugger to work you need to load the PDBs, to this go to Debug / Windows / Modules. Order by name, then ensure it says "Symbols loaded" in the row. If not then select Load Symbols from the context menu and select the PDBs extracted from the VSIX in the previous section.
  • Place your breakpoints.
  • Now you are ready to find those issues!

Note: if the break points are hollow, you have a mismatch in source code / AxoCover / PDBs. Please follow Preparation by the letter to resolve the issue.

Clone this wiki locally