Permalink
Browse files

handle the exception when starting ProcessMonitor(ManagementEventWatc…

…her).
  • Loading branch information...
1 parent 72660e1 commit f008d1852e77c46d57219f3b469f3c8ebbd4a351 @eusebiu eusebiu committed Feb 3, 2011
Showing with 10 additions and 5 deletions.
  1. +10 −5 src/AddIns/Debugger/Debugger.AddIn/Service/WindowsDebugger.cs
View
15 src/AddIns/Debugger/Debugger.AddIn/Service/WindowsDebugger.cs
@@ -157,11 +157,16 @@ public void Start(ProcessStartInfo processStartInfo)
if (index > -1){
Attach(processes[index]);
} else {
- this.monitor = new ProcessMonitor(processName);
- this.monitor.ProcessCreated += delegate {
- WorkbenchSingleton.SafeThreadCall((Action)(() => OnProcessCreated(defaultAppProcess, options)));
- };
- this.monitor.Start();
+ try {
+ this.monitor = new ProcessMonitor(processName);
+ this.monitor.ProcessCreated += delegate {
+ WorkbenchSingleton.SafeThreadCall((Action)(() => OnProcessCreated(defaultAppProcess, options)));
+ };
+ this.monitor.Start();
+ }
+ catch (System.Exception ex) {
+ LoggingService.ErrorFormatted("Process Monitor exception: {0}", ex.Message);
+ }
}
if (options.Data.WebServer == WebServer.IISExpress) {

0 comments on commit f008d18

Please sign in to comment.