Fixed PluginAssemblyLoadContext so it won't reload already loaded assemblies. (#214)
The appveyor build did not succeed but I guess that's OK since I will continue to work on this branch.
This commit is contained in:
Родитель
2f5a369eed
Коммит
1887262434
|
@ -39,12 +39,17 @@ namespace Microsoft.IIS.Administration
|
|||
Log.Logger.Debug($"Loading plugin {assemblyName}");
|
||||
|
||||
Assembly assembly = _loader.LoadFromAssemblyPath(assemblyPath);
|
||||
|
||||
_loadedAssemblies.Add(assembly);
|
||||
|
||||
//
|
||||
// Every module should expose a type called Startup in a namespace equivalent to the assembly name
|
||||
Type type = assembly.GetType(assemblyName + ".Startup");
|
||||
IModule module = (IModule) Activator.CreateInstance(type);
|
||||
Type type = assembly.GetType(assemblyName + ".Startup");
|
||||
|
||||
IModule module = (IModule)Activator.CreateInstance(type);
|
||||
|
||||
_moduleHolder.Add(module);
|
||||
|
||||
return assembly;
|
||||
}
|
||||
|
||||
|
|
|
@ -24,6 +24,12 @@ namespace Microsoft.IIS.Administration
|
|||
|
||||
protected override Assembly Load(AssemblyName assemblyName)
|
||||
{
|
||||
AssemblyName loaded = Assembly.GetEntryAssembly().GetReferencedAssemblies().FirstOrDefault(a => a.Name.Equals(assemblyName.Name));
|
||||
|
||||
if (loaded != null)
|
||||
{
|
||||
return Assembly.Load(loaded);
|
||||
}
|
||||
|
||||
Assembly asm = null;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче