Piotr Perak
Piotr Perak

Reputation: 11108

How to get memory dump on specific Exception after application pool recycle

After our app pool recycles our WCF services throw FileLoadException on access. Recycling of app pool helps. Sometimes the error goes away without recycling. I asked the question I asked first question about it here: FileLoadException when accessing WCF service

As we have no other ideas how to analyze this problem we would like to get memory dump with that Exception in it.

But I don't know how to configure adplus or debugdiag to attach automatically to that new process (after recycling) and generate crash dump on specific exception. Is that even possible?

Upvotes: 2

Views: 1539

Answers (2)

EdChum
EdChum

Reputation: 394309

Use WinDbg, attach it and add an event filter via the menu 'Debug>Event Filters...' Click 'Add..' and the error code should be 0x80131621 according to the MSDN page but it could be different which could be a problem and then enter gc. Otherwise I expect WinDbg to break when the exception occurs and you can then do a dump:

.dump /ma c:\dumps\mycrash.dmp

You may have looked at the following pages regarding how to debug this issue: http://blogs.msdn.com/b/suzcook/archive/2003/05/29/57120.aspx and http://bradwilson.typepad.com/blog/2007/12/we-were-crashin.html, related SO post

Upvotes: 2

Konrad Kokosa
Konrad Kokosa

Reputation: 16898

You can use Procdump to make the full memory dump on the first chance exception:

procdump -ma -e 1 -f FileLoadException w3wp.exe

But unfortunately you will probably have to attach it manually as I do not know any out-of-the-box solution. We are sometimes using PowerShell scripts for such tasks.

Upvotes: 3

Related Questions