My application has a plug-in model that allows third-party developers to write assemblies that will execute in the main application. Up until now, the practical use has been to allow only trusted developers to provide add-ins.
I'd like to expose the framework to untrusted developers. To do that, I'd like to restrict the assemblies to in-memory operation that doesn't touch any of the local resources (hardware, the Registry, databases, etc) and is only allowed to use a maximum amount of memory.
Currently, with the trusted assemblies, I'm just using Assembly.Load and reflection to instantiate the object. What I need is a good primer on how to restrict permissions on code loaded from an external assembly.