I have a program up and going that interacts with hardware, but I need to test the case of when the program crashes/aborts or anything to cause the program to exit unnormally to see what state is set to the hardware when the software crashes.
In C++ I saw a post about using an abort()
call (What is the easiest way to make a C++ program crash?), but I am unsure what the VB equivalent of that would be. The closest I have come is while debugging, to press the Stop Debugging button, but I think there is a better solution than that.
Is there any specific code that would cause this type of event to happen or is there a call like abort()
that would make it happen in a heartbeat?
Use the API Environment.FailFast
. This is a .Net API accessible from any managed language including VB.Net. It will ruthlessly terminate the current process
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With