aboutsummaryrefslogtreecommitdiff
path: root/VNLib.Plugins.Extensions.Loading
diff options
context:
space:
mode:
authorLibravatar vman <public@vaughnnugent.com>2022-12-28 23:48:48 -0500
committerLibravatar vman <public@vaughnnugent.com>2022-12-28 23:48:48 -0500
commit189c6714057bf45553847eaeb9ce97eb7272eb8c (patch)
treed8819e26d41bebec894e2ecdc7c69b4f98a32195 /VNLib.Plugins.Extensions.Loading
parent0c2fa662f60cf8b6b771fef3ff4c740eae17a83d (diff)
Share only vnlib types for now
Diffstat (limited to 'VNLib.Plugins.Extensions.Loading')
-rw-r--r--VNLib.Plugins.Extensions.Loading/AssemblyLoader.cs8
-rw-r--r--VNLib.Plugins.Extensions.Loading/LoadingExtensions.cs2
2 files changed, 5 insertions, 5 deletions
diff --git a/VNLib.Plugins.Extensions.Loading/AssemblyLoader.cs b/VNLib.Plugins.Extensions.Loading/AssemblyLoader.cs
index a53bb0a..5baf123 100644
--- a/VNLib.Plugins.Extensions.Loading/AssemblyLoader.cs
+++ b/VNLib.Plugins.Extensions.Loading/AssemblyLoader.cs
@@ -134,11 +134,11 @@ namespace VNLib.Plugins.Extensions.Loading
typeof(PluginBase),
};
- //Add all types that have already been loaded
- shared.AddRange(currentCtx.Assemblies.SelectMany(s => s.GetExportedTypes()));
+ //Share all VNLib internal libraries
+ shared.AddRange(currentCtx.Assemblies.Where(static s => s.FullName.Contains("VNLib", StringComparison.OrdinalIgnoreCase)).SelectMany(static s => s.GetExportedTypes()));
PluginLoader loader = PluginLoader.CreateFromAssemblyFile(assemblyName,
- currentCtx.IsCollectible,
+ currentCtx.IsCollectible,
shared.ToArray(),
conf =>
{
@@ -149,7 +149,7 @@ namespace VNLib.Plugins.Extensions.Loading
* a "child" collection of assemblies
*/
conf.DefaultContext = currentCtx;
-
+
conf.PreferSharedTypes = true;
//Share utils asm
diff --git a/VNLib.Plugins.Extensions.Loading/LoadingExtensions.cs b/VNLib.Plugins.Extensions.Loading/LoadingExtensions.cs
index 7e86900..c23f5e2 100644
--- a/VNLib.Plugins.Extensions.Loading/LoadingExtensions.cs
+++ b/VNLib.Plugins.Extensions.Loading/LoadingExtensions.cs
@@ -178,7 +178,7 @@ namespace VNLib.Plugins.Extensions.Loading
_ = pluginsBaseDir ?? throw new ArgumentNullException("path", "No plugin path is defined for the current host configuration, this is likely a bug");
//Get the first file that matches the search file
- string? asmFile = Directory.EnumerateFiles(pluginsBaseDir, assemblyName, dirSearchOption).FirstOrDefault();
+ string? asmFile = Directory.EnumerateFiles(pluginsBaseDir, assemblyName, dirSearchOption).FirstOrDefault();
_ = asmFile ?? throw new FileNotFoundException($"Failed to load custom assembly {assemblyName} from plugin directory");
//Load the assembly