From db7a4e3f6ebc66b9c5a862cc2d29bd6b6e15001d Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Thu, 1 May 2014 09:26:35 +0200 Subject: [PATCH] fix #441: Profiler crashes SharpDevelop cannot profile a DLL without a host executable --- .../Src/Dialogs/ProfileExecutableForm.xaml.cs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/AddIns/Analysis/Profiler/Frontend/AddIn/Src/Dialogs/ProfileExecutableForm.xaml.cs b/src/AddIns/Analysis/Profiler/Frontend/AddIn/Src/Dialogs/ProfileExecutableForm.xaml.cs index 88d126157f..37cb1bec4d 100644 --- a/src/AddIns/Analysis/Profiler/Frontend/AddIn/Src/Dialogs/ProfileExecutableForm.xaml.cs +++ b/src/AddIns/Analysis/Profiler/Frontend/AddIn/Src/Dialogs/ProfileExecutableForm.xaml.cs @@ -17,6 +17,7 @@ // DEALINGS IN THE SOFTWARE. using System; +using System.ComponentModel; using System.Diagnostics; using System.Globalization; using System.IO; @@ -86,12 +87,17 @@ namespace ICSharpCode.Profiler.AddIn.Dialogs MessageService.ShowError(StringParser.Parse("${res:AddIns.Profiler.ProfileExecutable.ErrorMessage}")); } catch (FileNotFoundException ex) { MessageService.ShowError(ex.Message); - } catch (DirectoryNotFoundException ex2) { - MessageService.ShowError(ex2.Message); - } catch (UnauthorizedAccessException ex4) { - MessageService.ShowError(ex4.Message); - } catch (Exception ex3) { - MessageService.ShowException(ex3); + } catch (DirectoryNotFoundException ex) { + MessageService.ShowError(ex.Message); + } catch (UnauthorizedAccessException ex) { + MessageService.ShowError(ex.Message); + } catch (Win32Exception ex) { + if ((uint)ex.HResult == 0x80004005) + MessageService.ShowError(ex.Message); + else + MessageService.ShowException(ex); + } catch (Exception ex) { + MessageService.ShowException(ex); } }