c# - How can I restrict an assembly's security permissions, but not those of its callees? -


i'm allowing users of application run snippets of c# able directly manipulate objects in assemblies without me having write big scripting interface layer explicitly expose everything.

this code injected dynamically compiled assembly, can control assembly itself, need stop code accessing private methods using reflection.

i tried calling securitypermissionobject.deny() before running code, blocks methods on objects using reflection (which do) when called user's code.

is there way restrict permissions on suspicious assembly without affecting public methods calls on trusted assemblies?

try create new appdomain. , use sandbox. within sandbox can load assembly in.

here example.

of course because have 2 appdomains complicates communictiaon bit. might consider webservice through pipe or other communication mechanisms.

here article of how 2 appdomains can communicate.


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -