What I have done is the to follow the instructions at
assembly with debug symbols. More precisely I did the following:
Imagine the assembly I want to debug is called ThirdParty.dll, and it is in
1. I generated an IL file from the assembly by using the following command:
ILDASM /OUT=ThirdParty.il /NOBAR /LINENUM /SOURCE ThirdParty.dll
2. I compiled the IL back into an assembly, this time generating a matching
ILASM /DEBUG /DLL /QUIET /OUTPUT=ThirdParty.dll ThirdParty.il
3. Next, I used the strong name utility to register my rebuilt assemly,
sn -Vr ThirdParty.dll
4. Finally, I installed the assembly into the GAC:
gacutil /i ThirdParty.dll /f
Now the assembly in the GAC is my assembly, rather than the original
author's assembly. I do the following to debug the assembly:
1. Start the process to debug (which loads the rebuilt assembly).
2. Start VS 2005
3. Have VS attach to the process to debug, using managed debugging.
4. Ensure symbols are loaded for the assembly to debug.
5. Open the ThirdParty.il in the VS IDE. Set a breakpoint on an IL
statement, just like I would in, say, a C# file.
Now my breakpoint in the IL is hit. I then try to clear the breakpoint in
the IDE, and it appears visually gone, but when the program executes the IL
statement, it still breaks into the de *** .