質問

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.

役に立ちましたか?

解決

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.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top