In fact, you can dynamically load assemblies into your application domain and run code from it, the problem is that you cannot unload the assembly. However, you can load additional application domains (and assemblies in them) and unload the application domain when you are done.
As its name implies, you have a new application domain, and you canโt just simply call its code and use its types necessary for marching your calls and data across the domain boundaries. If you do a search, you will find many examples of how to do this.
Something to keep in mind is that this is a common template, and there are ready-made solutions for it, the infrastructure itself has a whole addin namespace designed for this type of plug-in behavior, maybe it's worth it at the same time carefully having studied this. There is an article here that shows how to use it.
source share