refactor(core): harden PluginLoader per code review
Addresses code quality review of a7f0732:
- LoadedPlugin now holds the AssemblyLoadContext explicitly so Task 10
can call Unload() for hot reload (Critical)
- LoadedPlugin.Error is Exception? to match PluginDiscoveryResult and
preserve stack traces; synthetic failures build FileNotFoundException
and InvalidOperationException (Important)
- PluginLoader falls back to ReflectionTypeLoadException.Types if
GetTypes() can't fully resolve (Important)
- Hardcoded abstractions assembly name is now a const (Minor)
This commit is contained in:
parent
a7f0732026
commit
f6a57cbc6c
4 changed files with 45 additions and 8 deletions
|
|
@ -97,6 +97,6 @@ public class PluginLoaderTests
|
|||
var loaded = PluginLoader.Load(coreDllDir, manifest, host);
|
||||
|
||||
Assert.False(loaded.Success);
|
||||
Assert.Contains("IAcDreamPlugin", loaded.Error ?? "");
|
||||
Assert.Contains("IAcDreamPlugin", loaded.Error!.Message);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue