Reputation: 828
I am new to autofac and using .net 5-6 in my projects, i built my app in different modules which are loaded in app startup (using alc). But i was wondering if its possible with autofac to load/unload these full app plugins on runtime. much like how wordpress etc. are designed.
you load a zip file with all the plugin dll/files and it manages the info of it on runtime? including services & middlewares initialization.
Upvotes: 0
Views: 209
Reputation: 23894
Autofac does not perform the jobs of assembly loading, plugin management, etc. That's up to your application code. If you have your plugins managed as zip files or folders full of assemblies or whatever, it's up to your application to:
Assembly.Load
or whatever.You can then use the standard Autofac interfaces to make your registrations.
The point is, Autofac isn't a plugin framework it's a DI container. Anything outside of DI is up to you. Even if you're thinking about the assembly scanning logic, Autofac isn't loading or locating the assemblies - it's just scanning assemblies you've already loaded.
Upvotes: 0