Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Commit db7a4e3

Browse files
fix #441: Profiler crashes
SharpDevelop cannot profile a DLL without a host executable
1 parent a2236d7 commit db7a4e3

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

src/AddIns/Analysis/Profiler/Frontend/AddIn/Src/Dialogs/ProfileExecutableForm.xaml.cs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
// DEALINGS IN THE SOFTWARE.
1818

1919
using System;
20+
using System.ComponentModel;
2021
using System.Diagnostics;
2122
using System.Globalization;
2223
using System.IO;
@@ -86,12 +87,17 @@ void btnStartClick(object sender, RoutedEventArgs e)
8687
MessageService.ShowError(StringParser.Parse("${res:AddIns.Profiler.ProfileExecutable.ErrorMessage}"));
8788
} catch (FileNotFoundException ex) {
8889
MessageService.ShowError(ex.Message);
89-
} catch (DirectoryNotFoundException ex2) {
90-
MessageService.ShowError(ex2.Message);
91-
} catch (UnauthorizedAccessException ex4) {
92-
MessageService.ShowError(ex4.Message);
93-
} catch (Exception ex3) {
94-
MessageService.ShowException(ex3);
90+
} catch (DirectoryNotFoundException ex) {
91+
MessageService.ShowError(ex.Message);
92+
} catch (UnauthorizedAccessException ex) {
93+
MessageService.ShowError(ex.Message);
94+
} catch (Win32Exception ex) {
95+
if ((uint)ex.HResult == 0x80004005)
96+
MessageService.ShowError(ex.Message);
97+
else
98+
MessageService.ShowException(ex);
99+
} catch (Exception ex) {
100+
MessageService.ShowException(ex);
95101
}
96102
}
97103

0 commit comments

Comments
 (0)