TargetInvocationException: Exception has been thrown by the target of an invocation. StackTrace: at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) at System.Delegate.DynamicInvokeImpl(Object[] args) at Microsoft.Win32.SystemEvents.SystemEventInvokeInfo.InvokeCallback(Object arg) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) TypeInitializationException: The type initializer for 'Quicker.Domain.Services.SystemEventsWatcher' threw an exception. --TypeName: Quicker.Domain.Services.SystemEventsWatcher StackTrace: at Quicker.Domain.Services.SystemEventsWatcher.L17pwqeQGKX(Object , SessionSwitchEventArgs ) OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown. StackTrace: at Quicker.Domain.Services.SystemEventsWatcher..cctor()