Exemple #1
0
 private static void RunConsoleMode()
 {
     // Debug code: this allows the process to run as a non-service.
     // It will kick off the service start point, but never kill it.
     // Shut down the debugger to exit
     //TODO: this factory needs to be registered in a container to make this more general purpose
     using (var service = new PerfCounterReporterService())
     {
         // Put a breakpoint in OnStart to catch it
         typeof(PerfCounterReporterService).GetMethod("OnStart", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(service, new object[] { null });
         //make sure we don't release the instance yet ;0
         Thread.Sleep(Timeout.Infinite);
     }
 }
 private static void RunConsoleMode()
 {
     // Debug code: this allows the process to run as a non-service.
     // It will kick off the service start point, but never kill it.
     // Shut down the debugger to exit
     //TODO: this factory needs to be registered in a container to make this more general purpose
     using (var service = new PerfCounterReporterService())
     {
         // Put a breakpoint in OnStart to catch it
         typeof(PerfCounterReporterService).GetMethod("OnStart", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(service, new object[] { null });
         //make sure we don't release the instance yet ;0
         Thread.Sleep(Timeout.Infinite);
     }
 }