Search code examples
visual-studio-2015debug-symbolspdb-files

Visual Studio 2015 settings for generated pdb (debug symbols) file


Are there settings that affect the pdb file generated when VS2015 (or earlier versions) compiles a library?

Specifically, I am wanting it to not have the full file path. For example, given the stack trace

System.Exception: An exception has occurred.
  at Project.ClassA.MethodB() in C:\Sources\Solution\Project\ClassA.cs:line 100

I would prefer it be

System.Exception: An exception has occurred.
  at Project.ClassA.MethodB() in Project\ClassA.cs:line 100

Edit: The reason we are looking for this ability is because "C:\Sources\Solution\Project" is meaningless on the system where the application will eventually be tested/deployed, or even on some of our other developers' systems.

We could just not deploy the symbols at all, but they help provide more useful info when exceptions are logged.


Solution

  • PDB is a debug information file that Visual Studio uses. Go to Tools->Options->Debugging->Symbols and select checkbox "Microsoft Symbol Servers". Visual Studio will download PDB's automatically.

    And as far as I know the fully qualified name of the file is how Visual studio is able to find the file. I'm not sure nor have i ever heard of a way to change that behavior except for maybe putting project into the same directory as Visual Studio. Although I'm pretty sure it would still display the same way. I would need to see the full error code to provide more information that that.