From c355dc37bdacf835aefef60723b04056e8671445 Mon Sep 17 00:00:00 2001 From: 7sharp9 Date: Thu, 28 Oct 2021 18:11:07 +0100 Subject: [PATCH] Add shared types between host / plugins --- src/Myriad/Program.fs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Myriad/Program.fs b/src/Myriad/Program.fs index 45d09dc6..416f35a8 100644 --- a/src/Myriad/Program.fs +++ b/src/Myriad/Program.fs @@ -16,10 +16,11 @@ open McMaster.NETCore.Plugins module Implementation = let findPlugins (path: string) = - let loader = PluginLoader.CreateFromAssemblyFile(path) - let assembly = loader.LoadDefaultAssembly(); + let loader = PluginLoader.CreateFromAssemblyFile(path, sharedTypes = [|typeof; typeof |]) + let assembly = loader.LoadDefaultAssembly() + let types = assembly.GetTypes() let gens = - [ for t in assembly.GetTypes() do + [ for t in types do if t.GetCustomAttributes(typeof, true).Length > 0 then yield t ] gens