Reputation: 282875
I'm writing a library that compiles to a DLL which is ran by another C# app. I need some way to "see" some variables in my code. I don't have a console, and there's no way for me to output text to the other app.
I think I found before some program that would display all the Debug.WriteLine
for all running porgrams... can't remember the name of it. Anyone know it? Or at least know some way for me to debug this?
Upvotes: 3
Views: 278
Reputation: 5407
If you compile your library in debug mode, it will generate a pdb file alongside with the dll. You can then step in through your methods calls in the dll if you have the pdb in the same folder. To do this you need to open the .cs files from your library and put a breakpoint on the code.
I do not know if I'm clear enough, but say solution A uses dll B. Make sure that where dll B is you also have a related pdb file. Then in VS just use the Open File from the menu to open the .cs file you need to debug in. If the debugging symbols have been loaded correctly from the pdb the breakpoint symbol will be full and you will be able to debug the code.
If your not already in a VS session, you can just start VS. Attach a debugging session to the process which is running yourt code, open the .cs code file(s) from the dll (again you will need the pdb file, and the pdb file will need to be in the same folder as the dll) and you can then put breakpoint in the code file.
Upvotes: 1