Debug with symbols in Visual Studio

Note

A symbol server is available with Azure Artifacts in Azure DevOps Services and works best with Visual Studio 2017 Update 4 or later. Team Foundation Server users and users without the Azure Artifacts extension can publish symbols to a file share using a build task.

Symbol servers enable debuggers to automatically retrieve the correct symbol files without knowing product names, build numbers or package names. These files contain useful information for the debugger and generally have the PDB extension.

Add the symbol server to Visual Studio

To debug with symbols, select and add the Azure DevOps Services symbol server to your Visual Studio environment.

  1. Select Tools, then Options, then Debugging.

  2. Select Symbols and select the + sign to add a new Azure DevOps symbol server location.

    Add Azure DevOps Services Symbol Server in Visual Studio settings

  3. In the Connect to Azure DevOps Symbol Server dialog, select your account from the dropdown menu, then select the organization that you wish to connect to. Select Connect to connect to the symbol server.

    Connect to Azure DevOps Symbol Server

  4. Your symbol server is added to the list of symbol file locations.

    New symbol server added to the list of symbol file locations

Debugging optimized modules

If you're debugging an optimized module (e.g. something that was built with the Release configuration) and you haven't modified the default Enable Just My Code setting, Visual Studio will not automatically fetch symbols for the optimized module.

To debug the module, you can either:

  • Open the Modules window, right-click and select Load Symbols (recommended).
  • Select Tools then Options. Select Debugging in the right panel then chose General. uncheck Enable Just My Code.

We recommend enabling source link support to step into source code. To do so, check Enable Source Link support under Options > Debugging > General. By default Source Link support is enabled in Visual Studio.

If you choose to enable source server support, please consider the security implications before doing so.

If you're using Portable PDBs, Source Link does not support authenticating to private source repositories like Azure DevOps Services. See Source Link diagnostics for more details.

What's next?