``Type.IsAssignableFrom`` returning false unexpectedly in plugin-loading scenario
This is a plugin framework. The "base" DLL with a plugin class that is subclassed by plugin DLLs is located in
This plugin framework is loaded into the application process by .NET hosting, if that is somehow meaningful.
All plugins have project references with
I first ensure
Then for each plugin, I instantiate an
I then
{ROOT}/bin/fhcore.dll, while plugins are located in {ROOT}/modules/{PLUGIN_NAME}/{PLUGIN_NAME.dll}.This plugin framework is loaded into the application process by .NET hosting, if that is somehow meaningful.
All plugins have project references with
<Private>false</Private> and <ExcludeAssets>runtime</ExcludeAssets>, ex.I first ensure
bin/fhcore.dll is loaded into AssemblyLoadContext.Default.Then for each plugin, I instantiate an
AssemblyLoadContext as such:I then
LoadFromAssemblyPath the plugin into the context, and afterwards:- I clearly see that only the plugin itself (and any non-plugin-core dependencies thereof) are in the
FhLoadContext - A duplicate reference to the core did not sneak in.
typeof(BaseModule).IsAssignableFrom(plugin_type) still returns false for a given public class PluginModule : BaseModule in the plugin DLL. Why could that be?