Why won't my symbols (pdb) load from a local path?

I've just built my app which consists of some C++ and C# code and installed it on another machine. When I connect the remote debugger, I can debug C++ code ok, and step though it. However, when I try to debug C# code, the symbols don't seem to be loaded. I've tried bringing up the modules pane in visual studio and have browsed to the correct .pdb file, but I just get a message box telling me it doesn't match.

I can't figure out why this is happening. I've used chkmatch from here: http://www.debuginfo.com/tools/chkmatch.html - that reports that the .exe and .pdb I'm selecting do match.

I've wiped all my source, fetched and rebuilt everything, so I'm pretty sure I haven't got some old wrong hanging around .pdbs.

I've found this related question The Symbol file MyFile.pdb does not match the module But, that's more to do native symbols not matching. My native symbols match, it's just .net assemblies where the symbols refuse to match.

Any suggestions for things to check would be very welcome.

Thanks.

Update: I've managed to get the symbols to load now! But... the solution was to copy the symbol files to the remote computer and place them in the same folder as the .exe's and dll's on the remote machine. Visual Studio seems to refuse to load them from my local machine. If I right click on the module in the modules window and select 'Symbol Load Information...', this shows the paths where it's trying to load the symbols from, and this contains the correct local paths to where the pdb files are on my machine. I've looked at the security and access control properties for the pdbs, and given all access permissions to everyone.

This is really confusing, I'm sure in the past I've been able to load symbols ok. I can't think of anything I've changed that would suddenly cause this to stop working.

Why does Visual Studio refuse to load the symbol from my local machine?


This is it. PDB's for .NET remote debugging are always loaded from the remote machine. In the past I must have been copying pdb's to the remote machine, but I forgot about it.

http://www.wintellect.com/CS/blogs/jrobbins/archive/2009/05/26/visual-studio-remote-debugging-and-pdb-files.aspx


Ah. I know why I haven't had to remember to do the copy of pdb's to the remote machine for a while. I had a network folder mapping set up on the remote machine that mapped a drive to my local machine... and this was being used to resolve the path. I've got a local drive S: where I keep all my source code, and happened to be network mapping that to drive S: on the remote machine so everything was working. I think I'll re-add that mapping, and then I can debug without having to manually copy pdb's across.

That seems like a handy trick for remote debugging managed code. I just hadn't realized I was doing it!


Be aware this changed with Visual Studio 2013. As of 2013 the PDBs have to be on the local machine.

http://msdn.microsoft.com/en-us/library/ms241613.aspx

链接地址: http://www.djcxy.com/p/12936.html

上一篇: 你如何启用“启用.NET Framework源码步进”?

下一篇: 为什么我的符号(pdb)不能从本地路径加载?