I want to debug an application in Visual Studio but I ONLY have the source code for 1 class. I only need to step through a single function in that file, but I don’t understand what I need to do it. I think the steps are normally something like this:
- Open a file in VS
- Load in the ‘symbols’ (.PDB file)
- Attach to the running process
I know how to do #1 and #3, but I don’t how to do #2 without the .PDB file. Is it possible to generate the .PDB file for this to make it work? Thanks!
You need *.pdb files (step 2 from your post) These files contain mapping between source code and compiled assembly. So your step are correct. If your source file has differences with original file, set check mark ‘Allow the source code to be different from the original version’ in BP’s properties dialog.
Breakpoints and Tracepoints in Visual Studio
If you don’t have PDB files you can try to decompile your project using Reflector.FileDisassembler or FileGenerator For Reflector. They you can recompile these files to get PDBs
Also take a look at Deblector – debugging addin for Reflector.