Question

I have included a dll file into my project. I reference it from a library folder where also resides dll's pdb file. When I compile I see both dll and pdb copied to main project's bin folder. On small projects this works wonderfully and I can debug into the dll with no problems. Sometimes, however, in larger projects, VS keeps asking for specific cs files even though their pdb file is included in the projects bin folder. That's ok if I can find those cs files, but it's annoying.

Why is Visual Studio sometimes asking for cs files and sometimes not?

Was it helpful?

Solution

It tries its best given the information it has, but sometimes that information is incomplete. When its ready to give up, it gives you the opportunity to provide the file, just in case you know better.

PDBs generally store the path to the file, as it was when msbuild was invoked to build the DLL. If the paths have changed (e.g. you're on a different machine to where the DLL was built, or just that files on the file system have moved) then the path information doesn't do it much good.

There is a process called source indexing that can embed enough information into the PDBs so that visual studio can re-locate the source files in your source control system (so that you get exactly the correct file as it was at the time of the build) but this is usually an extra step that has to be performed to modify the PDBs after the build has occurred.

OTHER TIPS

Try this (from MSDN Forum)

Tools -> Options -> Debugging -> Symbols -> Empty Symbol Cache (button)

enter image description here

then

Tools -> Options -> Debugging General-> Enable Just My Code (checkbox)

enter image description here

and start debugging again. This should solve the problem if it was initiated by accidental third party components debug symbols that doesn't contains sources but storye only file paths.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top