Пример #1
0
        public ContextSwitchTests()
        {
            otherDomain = AppDomain.CreateDomain("other domain", null,
                AppDomain.CurrentDomain.BaseDirectory, null, false);

            contextSwitcher = (ContextSwitcher)otherDomain.CreateInstanceAndUnwrap(
                Assembly.GetExecutingAssembly().GetName().Name,
                typeof(ContextSwitcher).FullName);
        }
Пример #2
0
        public ContextSwitchTests()
        {
            FileInfo assemblyFile = new FileInfo(
                Assembly.GetExecutingAssembly().Location);

            otherDomain = AppDomain.CreateDomain("other domain", null,
                                                 AppDomain.CurrentDomain.BaseDirectory, null, false);

            contextSwitcher = (ContextSwitcher)otherDomain.CreateInstanceAndUnwrap(
                Assembly.GetExecutingAssembly().GetName().Name,
                typeof(ContextSwitcher).FullName);
        }
Пример #3
0
        public void FixtureSetUp()
        {
            FileInfo assemblyFile = new FileInfo(
                Assembly.GetExecutingAssembly().Location);

            otherDomain = AppDomain.CreateDomain("other domain", null,
                AppDomain.CurrentDomain.BaseDirectory, null, false);

            contextSwitcher = (ContextSwitcher)otherDomain.CreateInstanceAndUnwrap(
                Assembly.GetExecutingAssembly().GetName().Name,
                typeof(ContextSwitcher).FullName);
        }
Пример #4
0
		public ContextSwitchTests()
		{
            var assemblyName = Assembly.GetExecutingAssembly().FullName;
            var typeName = typeof(ContextSwitcher).FullName;

            var info = new AppDomainSetup();
            info.ApplicationBase = AppDomain.CurrentDomain.BaseDirectory;
            info.ApplicationName = Guid.NewGuid().ToString();

            otherDomain = AppDomain.CreateDomain(info.ApplicationName, null, info, 
                new PermissionSet(PermissionState.Unrestricted), new StrongName[0]);

            contextSwitcher = (ContextSwitcher)otherDomain.CreateInstanceAndUnwrap(assemblyName,
                typeName, false, BindingFlags.Default, null, new object[0], null, null, null);
		}
Пример #5
0
        public ContextSwitchTests()
        {
            var assemblyName = Assembly.GetExecutingAssembly().FullName;
            var typeName     = typeof(ContextSwitcher).FullName;

            var info = new AppDomainSetup();

            info.ApplicationBase = AppDomain.CurrentDomain.BaseDirectory;
            info.ApplicationName = Guid.NewGuid().ToString();

            otherDomain = AppDomain.CreateDomain(info.ApplicationName, null, info,
                                                 new PermissionSet(PermissionState.Unrestricted), new StrongName[0]);

            contextSwitcher = (ContextSwitcher)otherDomain.CreateInstanceAndUnwrap(assemblyName,
                                                                                   typeName, false, BindingFlags.Default, null, new object[0], null, null, null);
        }