You’ve seen the indexing and symbol publishing options when you set up a Team Build – but have you ever tried to debug and application that has symbols? How do you get VS to use the published symbols? What are these settings for anyway?
Source indexing and published symbols make possible to debug an application without shipping symbols. Source indexing produces pdb files during a build – essentially mapping the binary to the source code. During a team build, extra information is wrapped inside the pdbs – like the Team Foundation Server URL where they were built and version control paths to and versions of source code. This allows VS to download source code for debugging – and since there’s security involved (to access the TFS server) – source server support is disabled for debugging by default.
Fortunately enabling it is quite easy – especially if you read your Kindle copy of Inside the MS Build Engine (2nd edition) on the plane!
Open VS and go to Tools->Options->Debugging->General settings and tick the “Enable source server support”.
The DefaultTemplate.xaml for default builds supports symbol publishing. When you set up a Team Build, expand the “Basic Section”, set “Index Sources” to True and enter a UNC for the “Path to Publish Symbols” – try to stick to one global symbol store – TeamBuild will organise the symbols within this folder. The only time you’d really want multiple stores is for concurrency – only one build can publish at a time (that’s the way the Default Template is designed), so if you have lots of build going all the time and the indexing is slowing them, then you may want to add another store or two.
The final step is to tell VS where to find the published symbols. To add a symbol store in VS, go to Tools->Options->Debugging->Symbols and add the UNC to the store.