Process.HasExited returns true even though process is running?

后端 未结 11 2102
忘掉有多难
忘掉有多难 2020-12-15 03:41

I have been observing that Process.HasExited sometimes returns true even though the process is still running.

My code below starts a proces

11条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-15 04:20

    I realize this is an old post, but in my quest to find out why my app running the Exited event before the app had even opened I found out something that I though might be useful to people experiencing this problem in the future.

    When a process is started, it is assigned a PID. If the User is then prompted with the User Account Control dialog and selects 'Yes', the process is re-started and assigned a new PID.

    I sat with this for a few hours, hopefully this can save someone time.

提交回复
热议问题