1

I've searched far and wide for a solution to this but can't find one.

I have configured TeamCity to publish packages with both the symbols and source in them to ProGet. This process works great and ProGet correctly identifies the symbols.

I have setup Visual Studio as per the instructions on ProGet's knowledge base i.e.

  • Adding the symbol locations in options->Debugging->Symbols
  • Enabled source server support options->Debugging->general

I've checked in Fiddler and the symbols are downloaded when I launch our app in debug.

Then when stepping in to one of the methods in our package it opens the wrong file. The file it opens is however named the same (we have a file called Component in each of our packages and also in local solution that pulls in the package).

If I change the name of the file and re-package and publish it to ProGet the problem goes away and I can step in to file during debugging but this seems like a hack.

Does anyone know how you can get Visual Studio to favour the file on the symbol server over any local files in the solution with the same name?

Ben Thomson
  • 1,083
  • 13
  • 29

2 Answers2

2

Symbol files in the project directory are always loaded, for this issue, a sample could help us understand the symbols loaded easily. If your local cache folder had the symbols file which was downloaded from the Symbol Server before, I know that it would not download it again during you debug your app. So my understanding is that since your symbol file has the same name, the VS debugging would search and load the symbol from your local project folder firstly, and then download it from the symbol server or others if your local machine has no them. That's the reason why you got this issue.

The workarounds I could think of:

(1) Load the symbols manually from Debug modules windows if you really want to use two files with the same name.

(2) Using different names would be better.

Jack Zhai
  • 6,230
  • 1
  • 12
  • 20
  • It's my source files that have the same name (no symbol files). Sorry I wasn't sure if that's what you meant or not? I would have expected you to be able to step in to files of the same name because projects are likely to use conventions for file names? Perhaps this is a wrong assumption? – Ben Thomson Oct 07 '16 at 07:00
  • @Ben, I know that the same source file would have different matched PDB files during on every build, if you step into the wrong source file, one possible reason is that it loaded the wrong PDB/symbol files.https://blogs.msdn.microsoft.com/junfeng/2007/11/05/mismatched-pdbs-why/ – Jack Zhai Oct 07 '16 at 09:31
  • Not had a chance to look in to your suggestion in more detail yet. I hope to give it some time tomorrow and will update.. – Ben Thomson Oct 10 '16 at 13:14
  • I think our best option is to rename the files in the application, which seems like a bit of a hack but we can work it in to our process. We have also altered how we work with our packages locally so hopefully this won't be so much of an issue. – Ben Thomson Oct 13 '16 at 10:47
0

Right Click on the project containing the file you want to open and choose "Set as StartUp Project". Now when you try to debug, it will run the correct file.

Bekke
  • 1