public void CreateInAppDomain()
        {
            var resolver = AppDomainAssemblyResolver.CreateInAppDomain(_appDomain, AppDomain.CurrentDomain.BaseDirectory);

            Assert.That(RemotingServices.IsTransparentProxy(resolver), Is.True);
            Assert.That(resolver.AssemblyDirectory, Is.EqualTo(AppDomain.CurrentDomain.BaseDirectory));
        }
        public void CreateInAppDomain_FromShadowCopiedScenario()
        {
            var setupInfo = AppDomain.CurrentDomain.SetupInformation;

            setupInfo.ShadowCopyFiles = "true";
            var shadowCopiedAppDomain = AppDomain.CreateDomain("ShadowCopier", AppDomain.CurrentDomain.Evidence, setupInfo);

            try
            {
                shadowCopiedAppDomain.DoCallBack(
                    delegate
                {
                    var resolver = AppDomainAssemblyResolver.CreateInAppDomain(_appDomain, AppDomain.CurrentDomain.BaseDirectory);
                    Assert.That(resolver, Is.Not.Null);
                });
            }
            finally
            {
                AppDomain.Unload(shadowCopiedAppDomain);
            }
        }
 private AppDomainAssemblyResolver CreateResolver()
 {
     return(AppDomainAssemblyResolver.CreateInAppDomain(_appDomain, AppDomain.CurrentDomain.BaseDirectory));
 }