Reputation: 2249
I frequently need to debug .NET binaries on test machines (by test-machine, I mean that the machine doesn't have Visual Studio installed on it, it's frequently re-imaged, It's not the same machine that I do my development on, etc).
I love the Visual Studio debugger, but it's not practical for me to install visual studios on a freshly imaged test-machine just to debug an assertion or crash (the install takes way too long, the footprint is too large, etc).
I'd really like a quickly installed program that could break into a running process, let me specify the location of symbols/source code, and let me jump right into debugging. For native binaries, windbg works great, but I haven't found anything similiar for managed binaries. Any recommendations?
(as a side note, I am aware of visual studios remote debugging capabilities, but for some reason it never seems to work consistently for me... I often have connection issues)
Upvotes: 28
Views: 22745
Reputation: 8265
Use dnSpy.
dnSpy is a debugger and .NET assembly editor. You can use it to edit and debug assemblies even if you don't have any source code available.
It's so wonderful. Very small and lightweight. No installation or configuration needed. Its interface is exactly like Visual Studio. Even its shortcuts are the same as VS.
Features:
Upvotes: 11
Reputation: 1
Maybe you can try using Live Tuning combined with an Ocf Server?
It's not a debugger per-se, but it's pretty easy to get a connection between an app and Live Tuning. Like, literally 3 lines of code. Then you have access to all the variables you choose to publish.
I found it useful when trying to debug my programs without having access to the decompiled code or a real debugger. You can't really have breakpoints but it turns out there's sometimes better ways to debug.
Upvotes: 0
Reputation: 26109
You could check out MDbg: http://blogs.msdn.com/jmstall/archive/2006/11/22/mdbg-sample-2-1.aspx. It looks like it comes with the .NET 3.5 SDK at least (and it's probably included with 2.0+).
Windbg has managed extensions (called SOS I believe), though I don't know if they allow source-level debugging.
Upvotes: 1
Reputation: 117220
Version 2 of ILSpy contains a debugger. And it works awesome!
It is still in very early stages, but have helped me several times.
Just watch out for bugs! :)
Upvotes: 3
Reputation: 31
Have your tried using Cracked.NET ?
It's a runtime debugging and scripting tool that gives you access to the internals of any .NET desktop application running on your computer.
Upvotes: 1
Reputation: 2249
I've finally found extensions for Windbg that do just what I wanted: Sosex.dll, lets me use windbg to debug managed applications with very minimal installation required. I've used it for more than a year now, and It's worked, without fault, for every debugging scenario I've encountered.
Upvotes: 6
Reputation: 340168
For a bit nicer interface than MDbg or cordbg take a look at DbgCLR - a cut-down version of the Visual Studio debugger (at least it looks like one) that handles only managed code. It comes with the .NET Framework (I'm not sure if it's in the runtime or if you need the Framework SDK):
Note that cordbg is deprecated in favor of MDbg (even though MDbg doesn't have all of cordbg's features):
And in looking back at MDbg whle writing this post, I found that there's a GUI wrapper available for MDbg (which I haven't tried):
Upvotes: 10
Reputation: 47452
There is always mdbg and cordbg, but I would suggest digging more into why remote debugging doesn't work consistently.
VS2005/8 seem a lot more reliable than earlier versions here (though I primarily do unmanaged) and it saves you from having to have the symbols accessible on the target machine.
Upvotes: 4