|
All,
Sorry, this is not a short post, english is not my native language, if I confuse you, please ask, I will try to explain.
My Windows Service (myservice.exe) is based on .NET 2.0 framework (x86 32bit XP SP2), it uses threading and remoting, sometimes crashes. When it crashes, I could found a log event from event viewer, sometimes I could not.
============== Event Type: Error Event Source: .NET Runtime 2.0 Error Reporting Event Category: None Event ID: 5000 Date: 5/30/2009 Time: 7:46:40 AM User: N/A Computer: OEM-IDKVIEBJAWI Description: EventType clr20r3, P1 myservice.exe, P2 1.0.5.74, P3 4a121d7c, P4 mscorlib, P5 2.0.0.0, P6 471ebc5b, P7 1937, P8 0, P9 system.indexoutofrangeexception, P10 NIL. ==============
I have been trying to setup the registry to capture a memory dump, for example, I use these seetings:
(I use windbg version 6.11.0001 x86 32bit)
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework] "DbgManagedDebugger"="\"C:\\Program Files\\Debugging Tools for Windows\\cdb.exe\" -pv -p %ld -c \".dump /u /ma c:\\crashdump.dmp;.kill;qd\"" "DbgJITDebugLaunchSetting"=dword:00000002
It works with my test managed console application and winform application, their crash all create dump files.
BUT, no matter how I try, I just could not get these settings to work with windows service (myservice.exe)
Here are my questions:
1.Who add the log entry to windows event viewer, why sometimes it is there and sometimes it is not when myservice.exe crashes?
2.How do I capture the randomly crashing myservice.exe's memory dump?
3.Why the current registry setting does not work? - Edited bywebcliff2 Friday, June 05, 2009 6:21 PMmeanful title
- Edited bywebcliff2 Thursday, June 04, 2009 11:53 PMos version
-
All RepliesWhen your service starts register for the AppDomain UnhandledException event and do you own logging - this way you have control over what's logged. Without knowing what the how the service works if you don't see any entry in the event log maybe it did not crash, it just terminated for whatever reason. Have you tried using AeDebug registry key instead of DbgManagedDebugger ? (http://technet.microsoft.com/en-us/library/cc738371(WS.10).aspx).
|