I want to test if My application crash dump can be debugged, so I need generate a crash dump of my application firstly, but I write it with C#, so anybody know how to trigger a crash.(In fact I test with many exceptions, unsafe code......, but don't get it). thanks ---- sorry, sorry,I just lost somethings: I build the application with unity3d, which will handle exceptions for me automatic, and generate a crash dump for me if application crash
thanks all for your answers, I just test all your methods in common c# application and all works, but not unity3d application written with C#, it seems unity3d do more, I think I need to email unity3d to get a answer. I will post here if I get it.
A surefire way to do it is as follows:
All the others can be handled by the top level ApplicationDomain.OnUnhandledException and the like.
This one will kill it dead (assuming .NET 2.0+, and not using 'legacyUnhandledExceptionPolicy': http://msdn.microsoft.com/en-us/library/ms228965.aspx).
The following will provide an unhandled exception and will ask for you to choose a debugger:
Use below code to close the application.
Exit needs a parameter called exitcode. If exitcode=0 means there was no error. Supply a non-zero exit code to to reflect an error.
will cause an exception just as well
Throw an exception :)
Another option is to call