Implementing untrusted plugins in .NET web application -


i'd develop application accepts plugins user community, similar how chrome or firefox does. web application, each "instance" of application individual users run different plugins (plugins loaded singleton instances, "active" users). i'm planning on implementing application in .net, , trying come architecture plugin model.

here desired attributes:

  • plugins built entirely outside of core application, separate assemblies.
  • plugins run in own "locked down", low-trust environment. separate appdomain.
  • plugins can act through api provide. e.g. pass them sort of facade interface, , can call that, not call other assemblies. can't have plugins can arbitrarily take actions on web server, e.g. affect file system.
  • a fatal crash in addin cannot affect stability of core application.

it seems system.addin best bet, unclear on how can force loaded addins work through api provide, , not load other assemblies. system.addin provide functionality? also, can system.addin used asp.net / iis?

what other options have besides system.addin?

you try using appdomains , handle unhandled exceptions. avoid appdomain crashes, have handle appdomain.unhandledexception

in above link, note following statement

starting .net framework 4, event not raised exceptions corrupt state of process, such stack overflows or access violations, unless event handler security-critical , has handleprocesscorruptedstateexceptionsattribute attribute.

so may need explicitly handle configuration.

i have read lot of issues claiming when unhandled exceptions occur on different threads in child domain, bubble , bring down parent domain. if so, loading plugins separate process appdomain per plugin or loading plugins separate process may advisable.

i came across following question on believe find helpful


Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -