Ejemplo n.º 1
0
		public static void DestroyResolver(AppDomainTypeResolver resolver)
		{
			if (resolver == null) throw new ArgumentNullException("resolver");

			ThreadPool.QueueUserWorkItem(delegate
			                             {
			                             	AppDomain.Unload(resolver.Domain);
			                             });
		}
Ejemplo n.º 2
0
        public static AppDomainTypeResolver GetIntoNewAppDomain(string baseDir)
        {
            AppDomainSetup info = new AppDomainSetup();

            info.ApplicationBase = Environment.CurrentDirectory;
            AppDomain             domain   = AppDomain.CreateDomain("AppDomainTypeResolver", null, info, new PermissionSet(PermissionState.Unrestricted));
            AppDomainTypeResolver resolver = (AppDomainTypeResolver)domain.CreateInstanceAndUnwrap(typeof(AppDomainTypeResolver).Assembly.FullName,
                                                                                                   typeof(AppDomainTypeResolver).FullName, false, BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.CreateInstance, null, new object[] { domain, baseDir }, null, null, null);

            return(resolver);
        }
Ejemplo n.º 3
0
        public static void DestroyResolver(AppDomainTypeResolver resolver)
        {
            if (resolver == null)
            {
                throw new ArgumentNullException("resolver");
            }

            ThreadPool.QueueUserWorkItem(delegate
            {
                AppDomain.Unload(resolver.Domain);
            });
        }