Getting a Crash Dump for a .NET Application that Uses Native Interop
I have a .NET application that makes calls to a native Win32 DLL using interop services. When I run this program, it will crash somewhere inside the DLL. However, I have been unable to get any stack dump information.
When I run in the Visual Studio debugger, the debugger exits when the crash happens. I get the "Blah-blah-app has stopped working. Windows is checking for a solution to the problem...". If I click the Debug button that appears, I get an error message saying that the process 开发者_如何学Cis already open in a debugger, but the debugger from which I launched the app is not functional.
I have tried to enable local crash dumps, following the instructions here: Collecting User-Mode Dumps. However, no crash dump is generated, and I notice that the page says "Applications that do their own custom crash reporting, including .NET applications, are not supported by this feature."
It sounds like you are using managed debugging which is the default setting for managed projects. If you're having a crash in a native DLL you'll need to enable mixed mode debugging to get the events and stacks you're looking for.
- Right Click on the project and Select Properties
- Go to the Debug Tab
- Check the "Enable Unmanaged Debugging" checkbox
Repeat your scenario.
Install the Debugging Tools for Windows from the SDK and use windbg.exe
to debug the program.
When you get the "Blah-blah-app has stopped working..." message, the process still exists. You can find it in the Task Manager, right-click it and select Create Dump File.
精彩评论