Code Access Security exception in restricted AppDomain
问题 Goal : I need to run some code in an AppDomain with very limited permissions - it should have no access to anything at all fancy or unsafe, except for a few helper methods that I have defined elsewhere. What I've done : I'm creating a sandbox AppDomain with the required basic permissions, and creating a proxy object, which runs the code: static AppDomain CreateSandbox() { var e = new Evidence(); e.AddHostEvidence(new Zone(SecurityZone.Internet)); var ps = SecurityManager.GetStandardSandbox(e)