Symbol indexes could not be retrieved during TFS build

I changed my project to reference the new CustomChecks assembly (NServiceBus.CustomChecks). Everything builds and runs fine. However, when I try to build on TFS, I get the following issue when it is publishing the symbols path:

##[error]Indexed source information could not be retrieved from ‘\NServiceBus.CustomChecks.pdb’. Symbol indexes could not be retrieved.

This seems to have happened to other projects (MOQ, SendGrid, etc). It seems to be an issue with the portable PDB format.

I looked this up for MOQ and it seems you’re right : Issue with Moq.pdb in version 4.7.99: "Symbol indexes could not be retrieved" · Issue #428 · moq/moq4 · GitHub

We will discuss this internally and I’ll let you know asap what comes out of this.

@macdonald-k

What step from TFS is that error coming from? It sounds like you’ve got some sort of PDB source indexing step that includes publishing those indexed PDBs to a symbol server?

Is there some way to configure an exclusion list for what PDBs are included in that step? It doesn’t really make sense to be trying to index and publish 3rd party PDBs. I would expect you to only be doing that for your own PDBs.

We have switched to portable PDBs for several reasons. They are much smaller than the traditional Windows PDB format. We are also source linking our PDBs via GitHub - ctaggart/SourceLink: Source Code On Demand, so that they already include all information necessary to step into our source when debugging.

In general, source linking can be looked at as the next step in the evolution of source indexing & symbol publishing, so I expect you’ll run across these more often in the future.

I’m not familiar with TFS, so I don’t know what level of configuration you have over that symbol publishing step. If it turns out that you can’t exclude our PDBs, there is a utility that can be used to convert between PDB formats that you could try out as a step before the publishing step: GitHub - dotnet/symreader-converter: Converts between Windows PDB and Portable PDB formats.

It’s the basic Index Sources and Publish Symbols step
https://docs.microsoft.com/en-us/vsts/build-release/tasks/build/index-sources-publish-symbols

It looks like I can give it a search pattern for PDBs to include, so I’ll try that. <company_name>*.pdb

I have the same issue with GitHub - Particular/NServiceBus.Persistence.Sql: Native SQL Persistence for NServiceBus
It seems there are a lot of discussions around including/not including the pdb in nuget packages.
Should specific symbol packages be used for that case:
Creating legacy symbol packages (.symbols.nupkg) | Microsoft Learn