From 6a3db9d401744ca404a8613146102ffb33f42700 Mon Sep 17 00:00:00 2001 From: Christian Hornung Date: Fri, 15 Feb 2008 20:15:36 +0000 Subject: [PATCH] Load errors from referenced assemblies no longer prevent the forms designer from loading. Those errors are shown in the compiler message view instead. git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@2958 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61 --- .../Project/Src/Services/TypeResolutionService.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Services/TypeResolutionService.cs b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Services/TypeResolutionService.cs index 13dd113868..e23a56fea5 100644 --- a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Services/TypeResolutionService.cs +++ b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Services/TypeResolutionService.cs @@ -15,6 +15,7 @@ using System.Reflection; using ICSharpCode.Core; using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop.Dom; +using ICSharpCode.SharpDevelop.Gui; using ICSharpCode.SharpDevelop.Project; using Microsoft.Win32; @@ -213,7 +214,17 @@ namespace ICSharpCode.FormsDesigner.Services File.Delete(tempPath); } catch {} } else { - throw; // don't ignore other load errors + // Show other load errors in the compiler message view, + // but do not prevent the designer from loading. + // The error might be caused by an assembly that is + // not even needed for the designer to load. + LoggingService.Error("Error loading assembly " + fileName, e); + WorkbenchSingleton.Workbench.GetPad(typeof(CompilerMessageView)).BringPadToFront(); + TaskService.BuildMessageViewCategory.AppendText( + StringParser.Parse("${res:FileUtilityService.ErrorWhileLoading}") + + "\r\n" + fileName + "\r\n" + e.Message + "\r\n" + ); + return null; } } catch (FileLoadException e) { if (e.Message.Contains("HRESULT: 0x80131402")) {