public static void SubscribeASync(CimSession cimSession, string cimNamespace) { try { string query = QueryInstanceCore(); //Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("Press <Enter> to abort the subscription"); //Console.ResetColor(); IObservable<CimSubscriptionResult> queryInstances = cimSession.SubscribeAsync(cimNamespace, "WQL", query, GetOperationOptions()); TestObserver<CimSubscriptionResult> observer = new TestObserver<CimSubscriptionResult>(); IDisposable disposeAble = queryInstances.Subscribe(observer); Console.ReadLine(); disposeAble.Dispose(); } catch (CimException ex) { PrintCimException(ex); } catch( Exception ex) { Console.WriteLine(ex.Message); } }