Exemplo n.º 1
0
        private void CreatePlugin(Type type)
        {
            AppDomainSetup domaininfo = new AppDomainSetup
            {
                ApplicationBase   = AppDomain.CurrentDomain.SetupInformation.ApplicationBase,
                ConfigurationFile = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile
            };

            Evidence evidence = AppDomain.CurrentDomain.Evidence;

            _pluginSandbox = AppDomain.CreateDomain("PluginSandbox", evidence, domaininfo);
            _pluginSandbox.DomainUnload += ((sender, args) => _pluginSandbox = null);
            _plugin = (IBuildScreenPlugin)_pluginSandbox.CreateInstanceFromAndUnwrap(type.Assembly.Location, type.FullName);
        }
Exemplo n.º 2
0
        private void CreatePlugin(Type type)
        {
            AppDomainSetup domaininfo = new AppDomainSetup
            {
                ApplicationBase = AppDomain.CurrentDomain.SetupInformation.ApplicationBase,
                ConfigurationFile = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile
            };

            Evidence evidence = AppDomain.CurrentDomain.Evidence;
            _pluginSandbox = AppDomain.CreateDomain("PluginSandbox", evidence, domaininfo);
            _pluginSandbox.DomainUnload += ((sender, args) => _pluginSandbox = null);
            _plugin = (IBuildScreenPlugin)_pluginSandbox.CreateInstanceFromAndUnwrap(type.Assembly.Location, type.FullName);
        }