Reputation: 26048
I need to debug some assemblies due to they throw exceptions. It's my assemblies but I don't have the source code of them. What I have is their pdb files.
Is there any way to debug that assemblies by Visual Studio?
--EDIT--
Of course, I also can disassembly them to get *.il files of them. Would it help me somehow?
Upvotes: 8
Views: 13946
Reputation: 13329
dnSpy is the way to go if the program is a managed one, but you can open the .exe file in Visual Studio just as you would an .sln file.
You'll be able to debug and view the machine code.
For more information, see this blog post.
Upvotes: 0
Reputation: 1124
Actually there are a few ways to accomplish this:
Upvotes: 7
Reputation: 1764
Check out dotPeek: https://www.jetbrains.com/decompiler/
You can set this up as a symbol server inside visual studio to generate PDB files which allow you to debug. It is very easy to use and just as good as many of the paid products.
You can add libraries directly from nuget, or point to the DLL.
Upvotes: 1
Reputation: 33272
Not exactly in visual studio, but I wrote in the past such a tool inside reflector, calle d Deblector. Is no longer mantained by me but have a look. Of course the debugging experience is not the same you can have in Visual Studio, but is sometimes enought to get you out of troubles.
Upvotes: 1
Reputation: 11792
This is exactly why I paid for Reflector. Need to debug someone else's assembly? It works perfectly.
Upvotes: 4
Reputation: 577
As far as I know, the PDB files are just pointers for debugging. That is, if you don't have the source code then the PDB files will only give you the stacktrace.
I don't know if Visual Studio can handle it, you might need to hook up manually to the process.
Upvotes: 3