Update PluginLoader.cs

This commit is contained in:
Kurt 2021-11-27 13:54:38 -08:00
parent cc34d40120
commit b5b57ffa90

View file

@ -63,6 +63,11 @@ namespace PKHeX.WinForms
{
try
{
// Handle Costura merged plugin dll's; need to Attach for them to correctly retrieve their dependencies.
var assemblyLoaderType = z.GetType("Costura.AssemblyLoader", false);
var attachMethod = assemblyLoaderType?.GetMethod("Attach", BindingFlags.Static | BindingFlags.Public);
attachMethod?.Invoke(null, Array.Empty<object>());
var types = z.GetTypes();
return types.Where(type => IsTypePlugin(type, pluginType));
}