I'm creating an application that will run code in a sandboxed environment. This environment should only allow the untrusted code to process resources that it is explicity given and return a defined data type. I'm using the principals found in this article to setup the sandbox:
How to: Run Partially Trusted Code in a Sandbox
I also have some code that will need to run inside the sandboxed environment. Unfortunately, when I try to setup the type to run inside the sandbox I'm getting the following error:
Inheritance security rules violated by type: 'MyTypeRunningInSandbox'. Derived types must either match the security accessibility of the base type or be less accessible.
I'm not sure why I would get this error as both the base type and the derived type were created by me, and neither should be more or less secure than the other.
My Application Strucure (to help you understand):
TypeLoader class
\
Trusted Sandbox Manager (i.e. sets up a the new sandbox)
\ (the error is happening in this class while creating the
| new app domain)
|
|Untrusted Sandbox Manager (i.e. runs the untrusted code)
If you compare my solution with regard to the Microsoft article above, my code is failing on the equivalent to the following line:
ObjectHandle handle = Activator.CreateInstanceFrom(
newDomain, typeof(Sandboxer).Assembly.ManifestModule.FullyQualifiedName,
typeof(Sandboxer).FullName );
Any thoughts on how to troubleshoot this issue?