I am getting this error when binding to SystemEvents.PowerModeChanged in a WCF service hosted in IIS:
"System event notifications are not supported under the current context. Server processes, for example, may not support global system event notifications."
at Microsoft.Win32.SystemEvents.EnsureSystemEvents(Boolean requireHandle, Boolean throwOnRefusal)
at Microsoft.Win32.SystemEvents.add_PowerModeChanged(PowerModeChangedEventHandler value)
Looking online for some solutions but cannot find any. I am assuming this is an issue related to IIS hosting since the service has some layers of separation from the OS?
Are there any other events I could bind to which would indicate system "suspend" and "resume" states?