diff --git a/src/AddIns/Misc/UsageDataCollector/UsageDataCollector/UsageDataSessionWriter.cs b/src/AddIns/Misc/UsageDataCollector/UsageDataCollector/UsageDataSessionWriter.cs index 4e12446edd..03d967add8 100644 --- a/src/AddIns/Misc/UsageDataCollector/UsageDataCollector/UsageDataSessionWriter.cs +++ b/src/AddIns/Misc/UsageDataCollector/UsageDataCollector/UsageDataSessionWriter.cs @@ -303,9 +303,8 @@ namespace ICSharpCode.UsageDataCollector static string GetTypeName(Exception exception) { string type = exception.GetType().FullName; - ExternalException ee = exception as ExternalException; - if (ee != null) - return type + " (ErrorCode " + ee.ErrorCode.ToString("x8") + ")"; + if (exception is ExternalException || exception is System.IO.IOException) + return type + " (" + Marshal.GetHRForException(ee).ToString("x8") + ")"; else return type; } diff --git a/src/Main/Base/Project/Src/Gui/Workbench/Layouts/AvalonDockLayout.cs b/src/Main/Base/Project/Src/Gui/Workbench/Layouts/AvalonDockLayout.cs index fc3a74b50c..234c8cd9d8 100644 --- a/src/Main/Base/Project/Src/Gui/Workbench/Layouts/AvalonDockLayout.cs +++ b/src/Main/Base/Project/Src/Gui/Workbench/Layouts/AvalonDockLayout.cs @@ -309,7 +309,12 @@ namespace ICSharpCode.SharpDevelop.Gui Directory.CreateDirectory(configPath); string fileName = Path.Combine(configPath, current.FileName); LoggingService.Info("Saving layout file: " + fileName); - dockingManager.SaveLayout(fileName); + try { + dockingManager.SaveLayout(fileName); + } catch (IOException ex) { + // ignore IO errors (maybe switching layout in two SharpDevelop instances at once?) + LoggingService.Warn(ex); + } } } catch (Exception e) { MessageService.ShowException(e);