DynamicScriptSandbox
DynamicScriptSandbox copied to clipboard
Experiment with StrongName
It looks like we can mark the PluginCommon DLL as trusted by passing its "strong name" to AppDomain.CreateDomain(). This might allow us to remove various permissions from the PermissionSet, as code in PluginCommon would be allowed to perform the actions even when the AppDomain as a whole is restricted.
This seems to involve editing the project properties, going to the Signing tab, and enabling build-time signing. A public key pair is required. After that, it's just:
StrongName fullTrustAssembly =
typeof(PluginLoader).Assembly.Evidence.GetHostEvidence<StrongName>();