Browse Source

Don't ignore errors in ReflectionLoader, show real exception instead of failing later with a ArgumentNullException.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@556 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 21 years ago
parent
commit
fd56973207
  1. 4
      src/Main/Base/Project/Src/Dom/ReflectionLayer/ReflectionLoader.cs
  2. 12
      src/Main/Base/Project/Src/Services/ParserService/ProjectContentRegistry.cs

4
src/Main/Base/Project/Src/Dom/ReflectionLayer/ReflectionLoader.cs

@ -23,10 +23,12 @@ namespace ICSharpCode.SharpDevelop.Dom
{ {
try { try {
ReflectionProjectContent content = LoadProjectContent(fileName, include); ReflectionProjectContent content = LoadProjectContent(fileName, include);
if (content == null)
return null;
return DomPersistence.SaveProjectContent(content); return DomPersistence.SaveProjectContent(content);
} catch (Exception ex) { } catch (Exception ex) {
LoggingService.Error(ex); LoggingService.Error(ex);
return null; throw;
} }
} }

12
src/Main/Base/Project/Src/Services/ParserService/ProjectContentRegistry.cs

@ -158,11 +158,19 @@ namespace ICSharpCode.Core
object o = domain.CreateInstanceAndUnwrap(typeof(ReflectionLoader).Assembly.FullName, typeof(ReflectionLoader).FullName); object o = domain.CreateInstanceAndUnwrap(typeof(ReflectionLoader).Assembly.FullName, typeof(ReflectionLoader).FullName);
ReflectionLoader loader = (ReflectionLoader)o; ReflectionLoader loader = (ReflectionLoader)o;
database = loader.LoadAndCreateDatabase(filename, include); database = loader.LoadAndCreateDatabase(filename, include);
} catch (Exception e) {
database = null;
MessageService.ShowError(e);
} finally { } finally {
AppDomain.Unload(domain); AppDomain.Unload(domain);
} }
LoggingService.Debug("AppDomain finished, loading cache..."); if (database == null) {
return DomPersistence.LoadProjectContent(database); LoggingService.Debug("AppDomain finished but returned null...");
return null;
} else {
LoggingService.Debug("AppDomain finished, loading cache...");
return DomPersistence.LoadProjectContent(database);
}
} }
static Assembly GetDefaultAssembly(string shortName) static Assembly GetDefaultAssembly(string shortName)

Loading…
Cancel
Save