Troubleshooting PDB problems
Published 14 May 2018
If ANTS Performance Profiler cannot locate usable .pdb (debugging symbols) files for the application you are profiling, it can't display method source code or show line-level timings. You may see the error message "The profiler did not find any methods with source code."
This can mean that:
- No .pdb file exists for the application
- A .pdb file exists, but ANTS Performance Profiler can't locate it
- A .pdb file exists, but is out of date
- A corrupt .pdb file is causing ANTS Performance Profiler to crash
This page explains how to fix these issues.
To fix other issues causing missing results, see Troubleshooting missing results.
No .pdb file exists for the application
The method for creating a PDB depends on the type of application you are profiling.
If your application's namespace includes multiple DLLs, ANTS Performance Profiler will look for a PDB for each of them. Line-level profiling results and source-code display will be available only for methods in those DLLs for which ANTS Performance Profiler can locate the PDB.
ASP.NET web applications:
- Close ANTS Performance Profiler.
- Open the application's web.config file.
For instructions, see How to enable debugging for ASP.NET applications (MSDN) - Find the
compilation
tag and set itsdebug
attribute to true. - Restart ANTS Performance Profiler and try to profile your application again.
Simply rebuilding the assembly won't work unless debugging is enabled. Once the .pdb file has been created, you can set debug
to false without affecting it.
Other types of application:
See Debug settings and preparation (MSDN).
Decompiling methods without source
If you don't have a usable PDB file for an assembly, you can still display source code in ANTS Performance Profiler using the integrated decompilation feature. Line-level timings will be unavailable. For details, see Integrated decompilation.
A .pdb file exists, but ANTS Performance Profiler cannot locate it
For each of an application's assemblies, ANTS Performance Profiler looks for PDBs in the directory where the assembly's DLL is stored. (For ASP.NET web applications, this is by default the bin or app_bin folder.) If the PDB for a profiled assembly isn't in this folder, move it into this folder to enable line-level profiling and source code display.
Using a global PDB directory
If you can't move the PDBs for all your DLLs into a folder where ANTS Performance Profiler can find them (for example, if your application uses assemblies from the Global Assemblies Cache), you can bypass the problem by creating a global debugging symbols (PDB) directory.
Alternatively, if your application uses assemblies from the Global Assemblies Cache, you can copy your PDBs to the same directory as your DLLs in the Global Assemblies Cache.
A .pdb file exists, but is out of date
If the assembly has been changed since its .pdb file was generated, the PDB may be out of date. To update it:
- Enable debugging by following the steps under No .pdb file exists for the application above.
- Rebuild your assembly.
- Restart ANTS Performance Profiler and try to profile your application again.
Simply rebuilding the assembly will not work unless debugging is enabled.
A corrupt .pdb file causes ANTS Performance Profiler to crash
If ANTS Performance Profiler encounters a corrupt PDB during profiling, the profiler may crash and fail to return results. The corrupt PDB might belong to a third-party DLL or to the application you want to profile.
There are two ways to profile an application with a corrupt PDB:
- Delete the corrupt PDB.
This will prevent you from viewing source code referenced in the deleted PDB, but will display line-level code for all other methods.
- On the settings screen, in the Profiling mode dropdown menu, choose Method-level timings; all methods inc. framework.
This will prevent the corrupt PDB from being read, avoiding the cause of the crash. It will also prevent you from viewing source code referenced in the deleted PDB. Line-level timings are unavailable in this profiling mode.
Getting help
If you still can't fix your problem, please contact Redgate support. Supply as much information as you can, including:
- the type of application you are trying to profile
- the version of ANTS Performance Profiler you are using
- your computer's operating system
- the steps you have already tried
- any error messages ANTS Performance Profiler has generated, including any in the log files