Provide extra info when failing to initialize plugins with TypeLoadException

This commit is contained in:
Łukasz Domeradzki 2024-09-16 16:45:52 +02:00
parent cb4580c0d9
commit a27973800c
No known key found for this signature in database
GPG key ID: 6B138B4C64555AEA

View file

@ -216,6 +216,13 @@ public static class PluginsCore {
using CompositionHost container = configuration.CreateContainer();
activePlugins = container.GetExports<IPlugin>().ToHashSet();
} catch (TypeLoadException e) {
ASF.ArchiLogger.LogGenericError(Strings.FormatWarningFailedWithError(e.TypeName));
ASF.ArchiLogger.LogGenericException(e);
await Task.Delay(SharedInfo.InformationDelay).ConfigureAwait(false);
return false;
} catch (Exception e) {
ASF.ArchiLogger.LogGenericException(e);