Frage

I'm trying to use the application restart services in Microsoft.WindowsAPICodePack.ApplicationServices, however the restart isn't working. When the application quits due to an unhandled exception it isn't restarted. I've tried with both a Click Once install and as a stand alone EXE (no installer), running on Windows 8.

I'm using the following code to register for the restart:

ApplicationRestartRecoveryManager.RegisterForApplicationRestart(new RestartSettings(string.Empty,
                                                                                            RestartRestrictions.None));  

Any suggestions? Thanks.

War es hilfreich?

Lösung

I found my problem. In my tests of application restart, I was terminating the application too soon after launch.

From Microsoft documentation:

Windows Error Reporting (WER) will restart your application if it has been running for at least 60 seconds before becoming unresponsive or encountering an unhandled exception.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top