(To be served under "It worked for me, maybe it works for you.")
Rename the main function MainInternal by adding a new Main, which simply calls MainInternal.
When I did this, instead of receiving the "Application in interrupt mode" error message, I received an exception that I could examine when MainInternal was called.
source share