Plugin architecture in .net: unloading

I need to implement a plugin architecture in C # /. net to download

  • custom user actions
  • data type processing code for custom data grid / transformation / ...

from non-static linked assembly files.

Since the application must handle many user-defined user actions, Iam needs to unload them after they are completed in order to reduce memory usage.

I found some good articles about plugin architectures, for example:

but none of them gave me enough sausages to properly unload the assembly.

Since the program should be distributed, and user-defined actions (as indicated in the name) are determined by the user: how to prevent the assembly of malicious code (for example, closing my program, deleting files)?

Are there any other pitfalls you have encountered?

+5
source share
3 answers

Have you thought about how to use the environment of add-ons and extensions from MS? http://msdn.microsoft.com/en-us/magazine/cc163476.aspx

Michael

+4
source

One way is to load additional assemblies into a separate AppDomain. Unloading AppDomain will unload assemblies.

+4
source

. , AppDomain, .

This is essentially how the SQL CLR and ASP.NET work — thanks to the presence of the AppDomain transitional application for custom assemblies.

+1
source

All Articles