Is there a nice way to add modules from multiple assemblies without calling AddModule for each one #2360
-
I really want to seperate out each of my interaction modules into seperate projects, for the purpose of being able to deploy them seperately (and maybe eventually load/unload at runtime as well) I could call AddModuleAsync on each type one by one in my command service, but I'm wondering if there is a nicer way to discover and load modeules. I currentyly have a seperate assembly with all my modules, and pass that assembly in to AddModulesAsync, but this does not allow me to deploy individual modules seperately as they don't each have their own DLL when deployed Any guidance would be greatly appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Couldn't you get the assembly that the modules reside in then call Something akin to: |
Beta Was this translation helpful? Give feedback.
-
Thanks for your reply,
Like i say, I'm currently doing this which is fine, but what I want to do is have each module separated into its own assembly. That way they each have their own dll and can be deployed independently.
I would lime to avoid writing an add module line for every single module, I just feel like there ought to be a nice way to discover these modules (maybe by namespace?) And add all of the assemblies
On 12 Jun 2022 16:24, exsersewo ***@***.***> wrote:
Couldn't you get the assembly that the modules reside in then call AddModulesAsync on that?
Something akin to:
commandService.AddModulesAsync(type of(SuperAwesomeModule).Assembly, services ?? null);
—
Reply to this email directly, view it on GitHub<#2360 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACHR7QU2VY2GC6XGSW3QOJDVOX6LBANCNFSM5YRSG2FA>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
Couldn't you get the assembly that the modules reside in then call
AddModulesAsync
on that?Something akin to:
commandService.AddModulesAsync(typeof(SuperAwesomeModule).Assembly, services ?? null);