none
Cannot generate usable minidump file from ASP.NET RRS feed

  • Question

  •   Hi,

    I have a windows application where I recently added a way to save minidump on crash, by catching unhandled exception in AfxWinMain.
    I have also a ASP.NET website, which wraps the native dlls I use for my business logic layer in my window application, so that I can share the code for both legacy application and website (the code only is the same, since the dlls are compiled without /clr for Windows application, but with /clr for website).

    I want also an effective way to debug my website when it is in production (and precisely when something wrong is happening in the native dlls), but I have several problems:

    1) I don't know how to guard the entire code (in Windows app, everything happens in AfxWinMain, so it was easy to set the __try/__except at this place): in ASP.NET you have only some virtual functions in global.asax called by IIS libraries, but no "Run()" loop to put your __try around.
    I tried to use SetUnhandledExceptionFilter(MyExceptionFilter) from Application_Start() in global.asax, but "MyExceptionFilter" is never accessed on crash, as if SetUnhandledExceptionFilter did not work.
    I also tried AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException, but it is not always called either, and anyway, it seems that it is too late (my stack has changed when I jump into the handler).
    furthermore, if I catch an unhandled exception in Application_Start(), the only info that I get is the stack trace, which is not too bad, but does not always show the crashing functions in the native dll (precisely if the code is written between #pragma unmanaged), and in not as complete as a .dmp file, which can be used to reproduce the exact environment when it crashed.

    2) when I am developing the ASP.NET solution, the "Debug/save dump as ..." command is not available. Why ?

    3) I created a test function (an acces violation guarded by __try/__except) in my native app, that is called by ASP.NET application and that calls the function I use with my Windows app to generate minidump. It works but hangs for about 1 minute before generating a 1.5Mb dump file.
    When I then try to open the dump file in VS2005, it works, but says that "No symbols are loaded for any call stack frame. The source code cannot be displayed" and the stack shows only plenty of lines with system dlls like "mscorwks.dll" or "ntdll.dll", but surely not my native DLLs where the crash occured.

    To sum it up:
    Is there a way to get better info than stack trace with ASP.NET, when a crash is occuring in a native dll ?

    Regards,
    Leto
    Tuesday, July 29, 2008 11:36 AM

Answers