I have a dotnet windows service that's currently hung, but running. Is there anyway to attach a debugger to it, despite the lack of symbols; and that it's already running?
views:
183answers:
3From MS dev IDE Debug -> Processes -> Attach (After you choose a process.) You might have to click the "show system processes" box. There may be no useful information though...
Ignore the "no symbols" warning. Once you have a native debugger attached (i prefer WinDbg for stuff like this), then load up the SoS tool pack:
.loadby sos mscorwks
Now you can get a managed callstack using the !clrstack
command, and hope that gives you enough information to figure out the hang. Here's a handy cheat-sheet with a few others if that doesn't do it for you.
Won't help you this time, but... get in the habit of turning on symbol file generation for debug and release-mode builds. There's no reason not to, and it'll make your life a bit easier in situations like this.
Here is sample code, links to tools, and presentations on how to debug a hung .NET process.
You probably also want to watch this video presentation, which features the same tools and samples. Despite the Swedish text on the web page, the video is in English.