How do I debug a .net Fatal Execution Engine Error?

三世轮回 提交于 2019-12-04 08:05:35

Short answer: read the blog of Tess Ferrandez. This contains lots of invaluable guidance to debugging .NET applications and guides you through how to do it.

Longer answer...

Within Visual Studio

If you have Visual Studio installed you could try breaking on any unhandled .NET exception. To enable this, go to the menu and choose Debug, Exceptions and tick Common Language Runtime Exceptions. Then go to Tools, Options, Debugging and untick Enable Just My Code. Finally, attach to the process of the Configuration Wizard (you obviously need it running first) and the Visual Studio debugger will break at the point the exception occurs.

Assuming the debugger breaks (if it doesn't you have attached to the wrong process) then you should have access to the call stack and can make some educated guesses from the method names about what is going wrong. However there is a possibility this is obfuscated which won't be helpful. You will also be able to see the current MSIL instruction the debugger has stopped on. This is where it starts getting a bit beyond me but there are good references out there to help you understand what's happening in the code.

Without Visual Studio

If you don't have Visual Studio or for some reason can't get the debugger to break, then it is possible to create a dump of the crashing process. There are two methods I know of. One is described by the Windows Server Performance Team using good ol' Dr Watson. The other is a new tool has just been released by Mark Russinovich called ProcInfo that can automatically create a dump of a process that crashes through unhandled exceptions. There are probably other methods.

Once you have the dump you can use this KB article to help you get set up to debug it.

Finally

Return to the 'short answer' above: read Tess' blog to progress further! This is a big topic and she has the best resources I've eveer found. Also there is a good post by Vincent Rothwell which might help but it's really targeted towards debugging your own code.

As an aside - you shouldn't be getting the exceptions you are. It indicates a pretty serious problem. I would look at corruption, serious hardware faults, and consider a rebuild.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!