Visual Studio 2010 C ++ debugged characters loaded but cannot find source code

I specified a file with the symbol (pdb) inside 2010, so that it was loaded correctly, but I get the error No source available , and Browse to Find Source Code is greyed out. Does anyone know how I can specify a source code directory or look in pdb to find out where it is?

EDIT: My DLL is being called by an external program. The error occurs inside my DLL, so I have the source code. When an error occurs, I click Debug, the pdb characters are loaded, but not the source.

+7
source share
3 answers

If you moved the DLL from your build directory, the debugger is unlikely to find the source code files. The first thing you can do is right-click the root of the solution node in the Solution Explorer window, properties, general properties, debug source files and add the path to the source directory of the DLL project.

The second way: the debugger offers you the first time to find the source code file. If you have ever clicked Cancel in this dialog box, it’s a pretty common thing when you don’t know what it really sets, then the ID environment remembers your choice and will not ask you again. Fix this by deleting or renaming the hidden .suo file in the solution directory.

+4
source

From what I understand, you just want to debug your program, which you have as a DLL. The problem is that the external program uses this DLL, and you click "Debug" from the window that appears after . Mistake.

I assume that you want to open your project in Visual Studio, and then press Ctrl + Alt + P to open the "Attach to process" window, where you have to select the process that uses this DLL (iexplore.exe or whatever you work) so you can switch some breakpoints and see what happens in before , an error occurs.

+1
source

Hack by @Hans Passant works, but there really is an official way to achieve this: right-click your solution in the solution explorer, select Properties / General Properties / Debug Source Files. You should see and edit the list of all files in which you previously selected "cancel" when prompted to specify the path to the source.

enter image description here

+1
source

All Articles