Reputation: 53
I have a Visual Studio class library DLL that I build with MSBuild, which when used in the Debug configuration, copies the DLL, the PDB, and various resource files, into a web application. The problem I have is that when I debug the web application, the Visual Studio 2010 debugger will only load the symbols from the PDB file that was left behind in the intermediate directory created during the build. Even if I specify the symbol location in VS to include the folder in the web application, this is always ignored, and VS always goes straight to the intermediate location, which is evidentally somehow hardcoded into the DLL. By intermediate directory here, I mean the folder which can be set in MSBuild using the BaseIntermediateOutputPath property, and which will default to creating an obj folder if this setting is not explicitly included.
Why is the Visual Studio 2010 debugger doing this? I can't see any exlicit reference to an obj folder anywhere in my project properties. It is causing me great difficulty when trying to configure a remote debugger setup. Is there anyway to override this behaviour, or is a bug in VS 2010?
Has anybody encountered such an issue before, and if so, is there any workaround?
Thanks if you can help.
Upvotes: 0
Views: 471
Reputation: 4647
Actually the pdb location is embedded in the dll. You can find this path using
dumpbin /headers <your.dll>
The first location to be searched will be the one referred to you in your dll and it will be found if you are running your binaries on the same machine as your build machine.
See this great article on pdbs @ http://www.wintellect.com/CS/blogs/jrobbins/archive/2009/05/11/pdb-files-what-every-developer-must-know.aspx
There is a workaround provided at the end of the article using a custom subst.exe. Hope that helps.
Upvotes: 1