How to create minidumps in C#

  • Thread starter Thread starter Patricio
  • Start date Start date
P

Patricio

Hello,

I need to create minidumps (or the equivalent) to debug C# applications
post-mortem. I know that it is possible in C++ using minidumps.

I read some old posts where they said that for C# it is impossible to use
minidumps (because they don't have enough information) and that the only way
was to use full dumps. But I still don't know how to configure the
application (assemblies) to create this dump and how to use them for
analysis.

Any help is appreciated.

Best regrads,
Patricio.
 
Hi Patricio,
In addition to Nicholas's comment, we also could use Stacktrace to achieve
this goal. Please refer to following article:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystemdiagnosticsstackframeclasstopic.asp

I hope the above information is helpful for you. If you have any questions,
please feel free to let me know. Thanks and have a nice day!

Best Regards,

Terry Fei [MSFT]
Microsoft Community Support
Get Secure! www.microsoft.com/security

--------------------
From: "Nicholas Paldino [.NET/C# MVP]" <[email protected]>
References: <#[email protected]>
Subject: Re: How to create minidumps in C#
Date: Sat, 21 Jan 2006 11:55:16 -0500
Lines: 35
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
Message-ID: <#[email protected]>
Newsgroups: microsoft.public.dotnet.languages.csharp
NNTP-Posting-Host: cpe-24-90-143-84.nyc.res.rr.com 24.90.143.84
Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.dotnet.languages.csharp:380216
X-Tomcat-NG: microsoft.public.dotnet.languages.csharp

Patricio,

Here are a few links that should help you:

http://www.codeproject.com/debug/postmortemdebug_standalone1.asp

http://blogs.msdn.com/scottno/archive/2004/07/26/197757.aspx

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Patricio said:
Hello,

I need to create minidumps (or the equivalent) to debug C# applications
post-mortem. I know that it is possible in C++ using minidumps.

I read some old posts where they said that for C# it is impossible to use
minidumps (because they don't have enough information) and that the only
way was to use full dumps. But I still don't know how to configure the
application (assemblies) to create this dump and how to use them for
analysis.

Any help is appreciated.

Best regrads,
Patricio.
 
Thank you Nicholas and Terry for the information.

From what I read in the links it seems that I need to attach a debugger to
the running application to create the full user dumps.

In the C++ scenario it seems that the same application can implement a
handler to generate the dump, but it seems that this is not possible with
C#, isn't?

One more question: in a scenario where a unmanaged C++ application uses a
managed C++ dll which itself uses a C# dll, will a full dump generated by
the unmanaged C++ application (triggered by a C# dll exception) contain
information to debug the C# dll?

Thank you in advance for your answers,
Patricio.

"TerryFei" said:
Hi Patricio,
In addition to Nicholas's comment, we also could use Stacktrace to achieve
this goal. Please refer to following article:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystemdiagnosticsstackframeclasstopic.asp

I hope the above information is helpful for you. If you have any
questions,
please feel free to let me know. Thanks and have a nice day!

Best Regards,

Terry Fei [MSFT]
Microsoft Community Support
Get Secure! www.microsoft.com/security

--------------------
From: "Nicholas Paldino [.NET/C# MVP]" <[email protected]>
References: <#[email protected]>
Subject: Re: How to create minidumps in C#
Date: Sat, 21 Jan 2006 11:55:16 -0500
Lines: 35
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
Message-ID: <#[email protected]>
Newsgroups: microsoft.public.dotnet.languages.csharp
NNTP-Posting-Host: cpe-24-90-143-84.nyc.res.rr.com 24.90.143.84
Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.languages.csharp:380216
X-Tomcat-NG: microsoft.public.dotnet.languages.csharp

Patricio,

Here are a few links that should help you:

http://www.codeproject.com/debug/postmortemdebug_standalone1.asp

http://blogs.msdn.com/scottno/archive/2004/07/26/197757.aspx

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Patricio said:
Hello,

I need to create minidumps (or the equivalent) to debug C# applications
post-mortem. I know that it is possible in C++ using minidumps.

I read some old posts where they said that for C# it is impossible to use
minidumps (because they don't have enough information) and that the only
way was to use full dumps. But I still don't know how to configure the
application (assemblies) to create this dump and how to use them for
analysis.

Any help is appreciated.

Best regrads,
Patricio.
 
Patricio said:
Thank you Nicholas and Terry for the information.

From what I read in the links it seems that I need to attach a debugger to
the running application to create the full user dumps.

You can also use userdump.exe or Dr. Watson to create dumps. userdump
works good from an "unhandled exception handler".
In the C++ scenario it seems that the same application can implement a
handler to generate the dump, but it seems that this is not possible with
C#, isn't?

It is, you can hook events for that:
Application.ThreadException
AppDomain.UnhandledException
One more question: in a scenario where a unmanaged C++ application uses a
managed C++ dll which itself uses a C# dll, will a full dump generated by
the unmanaged C++ application (triggered by a C# dll exception) contain
information to debug the C# dll?

It should be accessible via SOS.
Thank you in advance for your answers,
Patricio.

HTH,
Andy
 
Thank you for the information Andreas. Now I have several options to
handle my situation.

Best regards,
Patricio.
 
Hi Patrico,,

I am glad to know that the problem has been resolved now.Thanks for
participating the community!

Best Regards,

Terry Fei [MSFT]
Microsoft Community Support
Get Secure! www.microsoft.com/security

--------------------
From: "Patricio" <[email protected]>
References: <#[email protected]>
<#[email protected]>
Subject: Re: How to create minidumps in C#
Date: Mon, 23 Jan 2006 16:31:31 -0500
Lines: 44
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
Message-ID: <[email protected]>
Newsgroups: microsoft.public.dotnet.languages.csharp
NNTP-Posting-Host: 205.152.247.15
Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP15.phx.gbl
Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.dotnet.languages.csharp:380741
X-Tomcat-NG: microsoft.public.dotnet.languages.csharp

Thank you for the information Andreas. Now I have several options to
handle my situation.

Best regards,
Patricio.
 
Back
Top