문제

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