diff options
author | WouterTinus <wouter.tinus@gmail.com> | 2019-09-07 01:36:12 +0200 |
---|---|---|
committer | WouterTinus <wouter.tinus@gmail.com> | 2019-09-07 01:36:12 +0200 |
commit | 7673fa357a81444cf6c216267dfab4e76684ba5c (patch) | |
tree | 73c0bd36e5b6261cd89a168c2a099f6556c59f4d /src/main.lib/Services/PluginService.cs | |
parent | 42aa0faa4de6ea4184cfe1a5830508777418b11a (diff) | |
download | letsencrypt-win-simple-7673fa357a81444cf6c216267dfab4e76684ba5c.zip letsencrypt-win-simple-7673fa357a81444cf6c216267dfab4e76684ba5c.tar.gz letsencrypt-win-simple-7673fa357a81444cf6c216267dfab4e76684ba5c.tar.bz2 |
move plugins & re-implement WebDav
Diffstat (limited to 'src/main.lib/Services/PluginService.cs')
-rw-r--r-- | src/main.lib/Services/PluginService.cs | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/main.lib/Services/PluginService.cs b/src/main.lib/Services/PluginService.cs index dd1840d..fadfea8 100644 --- a/src/main.lib/Services/PluginService.cs +++ b/src/main.lib/Services/PluginService.cs @@ -146,11 +146,25 @@ namespace PKISharp.WACS.Services private List<Type> GetTypes() { var ret = new List<Type>(); - foreach (var ass in AppDomain.CurrentDomain.GetAssemblies()) + foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies()) { - if (ass.FullName.Contains("wacs")) + if (assembly.FullName.Contains("wacs")) { - ret.AddRange(ass.GetTypes()); + IEnumerable<Type> types = new List<Type>(); + try + { + types = assembly.GetTypes(); + } + catch (ReflectionTypeLoadException rex) + { + types = rex.Types; + _log.Error("Error loading some types from assembly {assembly}: {@ex}", assembly.FullName, rex); + } + catch (Exception ex) + { + _log.Error("Error loading any types from assembly {assembly}: {@ex}", assembly.FullName, ex); + } + ret.AddRange(types); } } |