0

I tried hibernating the system within a button event:

Application.SetSuspendState(PowerState.Hibernate, true, true)

It started like normal, screens turns off and after a while the pc is powered off. When I turn back on it behaves like a reboot. Nothing is restored.

I see the boot sequence with no indication of a resuming of activity nor any error displayed (the 'resume fail' didn't show up).

How can I troubleshoot this if executing this shuts down the system?

beppe9000
  • 1,056
  • 1
  • 13
  • 28
  • According to documentation [Application.​Set​Suspend​State](https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.application.setsuspendstate?view=netframework-4.8), what you described seems to be the expected behavior. Were running applications restored when you turned the computer back on? – RobertBaron Jun 30 '19 at 23:05
  • @RobertBaron nothing was restored. As if it was a shutdown – beppe9000 Jun 30 '19 at 23:16
  • If you know a computer where when it is manually set to hibernating state, it correctly resumes its active state when turned back on, try to run your application on that computer. If you have the same behavior as with your current computer, then problem is most likely with your application, otherwise, there must be differences between the two computers which cause one to work correctly and the other not. – RobertBaron Jul 01 '19 at 12:18
  • I regularly hibernate this pc manually... but I'll do the test – beppe9000 Jul 01 '19 at 13:01
  • I run the code again and worked good. Further testing revealed the workstation was prone to overheating due to dust accumulation. – beppe9000 Jul 19 '19 at 17:25

1 Answers1

0

Not sure if I have to close the question or not. Anyways: I run the code again and worked good. Further testing revealed the workstation was prone to overheating (at 80°C and more in the CPU) due to dust accumulation.

I had switched to suspending instead of hibernating as a workaround: it's faster and basically the same unless total power shutdown is required. I suspect that the process of dumping the RAM on the disk caused the temperature to increase too much.

beppe9000
  • 1,056
  • 1
  • 13
  • 28