Beispiel #1
0
        private void EnsureInitialized()
        {
            if (_deployer != null)
            {
                return;
            }

            var deploymentParameters = new IISDeploymentParameters(Helpers.GetInProcessTestSitesPath(),
                                                                   DeployerSelector.ServerType,
                                                                   RuntimeFlavor.CoreClr,
                                                                   RuntimeArchitecture.x64)
            {
                TargetFramework = Tfm.NetCoreApp30,
                AncmVersion     = AncmVersion.AspNetCoreModuleV2,
                HostingModel    = HostingModel.InProcess,
                PublishApplicationBeforeDeployment = true
            };

            _configure(deploymentParameters);

            deploymentParameters.ApplicationPublisher = new PublishedApplicationPublisher(deploymentParameters.ApplicationPath);

            _deployer         = IISApplicationDeployerFactory.Create(deploymentParameters, _loggerFactory);
            _deploymentResult = (IISDeploymentResult)_deployer.DeployAsync().Result;
        }
Beispiel #2
0
        public IISTestSiteFixture()
        {
            var logging = AssemblyTestLog.ForAssembly(typeof(IISTestSiteFixture).Assembly);

            var deploymentParameters = new IISDeploymentParameters(Helpers.GetInProcessTestSitesPath(),
                                                                   DeployerSelector.ServerType,
                                                                   RuntimeFlavor.CoreClr,
                                                                   RuntimeArchitecture.x64)
            {
                TargetFramework = Tfm.NetCoreApp22,
                AncmVersion     = AncmVersion.AspNetCoreModuleV2,
                HostingModel    = HostingModel.InProcess,
                PublishApplicationBeforeDeployment = true,
            };

            _forwardingProvider = new ForwardingProvider();
            var loggerFactory = logging.CreateLoggerFactory(null, nameof(IISTestSiteFixture));

            loggerFactory.AddProvider(_forwardingProvider);

            _deployer = IISApplicationDeployerFactory.Create(deploymentParameters, loggerFactory);

            DeploymentResult = _deployer.DeployAsync().Result;
            Client           = DeploymentResult.HttpClient;
            BaseUri          = DeploymentResult.ApplicationBaseUri;
            ShutdownToken    = DeploymentResult.HostShutdownToken;
        }
Beispiel #3
0
        private void EnsureInitialized()
        {
            if (_deployer != null)
            {
                return;
            }

            _configure(DeploymentParameters);

            _deployer         = IISApplicationDeployerFactory.Create(DeploymentParameters, _loggerFactory);
            _deploymentResult = (IISDeploymentResult)_deployer.DeployAsync().Result;
        }
Beispiel #4
0
        public void Setup()
        {
            var deploymentParameters = new DeploymentParameters(Path.Combine(TestPathUtilities.GetSolutionRootDirectory("IISIntegration"), "test/testassets/InProcessWebSite"),
                                                                ServerType.IISExpress,
                                                                RuntimeFlavor.CoreClr,
                                                                RuntimeArchitecture.x64)
            {
                ServerConfigTemplateContent = File.ReadAllText("IISExpress.config"),
                SiteName        = "HttpTestSite",
                TargetFramework = "netcoreapp2.1",
                ApplicationType = ApplicationType.Portable
            };

            _deployer = ApplicationDeployerFactory.Create(deploymentParameters, NullLoggerFactory.Instance);
            _client   = _deployer.DeployAsync().Result.HttpClient;
        }
Beispiel #5
0
        public void Setup()
        {
// Deployers do not work in distributed environments
// see https://github.com/dotnet/aspnetcore/issues/10268 and https://github.com/dotnet/extensions/issues/1697
#pragma warning disable 0618
            var deploymentParameters = new DeploymentParameters(Path.Combine(TestPathUtilities.GetSolutionRootDirectory("IISIntegration"), "IIS/test/testassets/InProcessWebSite"),
                                                                ServerType.IISExpress,
                                                                RuntimeFlavor.CoreClr,
                                                                RuntimeArchitecture.x64)
            {
#pragma warning restore 0618
                ServerConfigTemplateContent = File.ReadAllText("IIS.config"),
                SiteName        = "HttpTestSite",
                TargetFramework = "netcoreapp2.1",
                ApplicationType = ApplicationType.Portable
            };
            _deployer = ApplicationDeployerFactory.Create(deploymentParameters, NullLoggerFactory.Instance);
            _client   = _deployer.DeployAsync().Result.HttpClient;
        }
Beispiel #6
0
        protected virtual Task <DeploymentResult> CreateDeploymentAsyncCore(ILoggerFactory loggerFactory)
        {
            CopyDirectory(new DirectoryInfo(ApplicationPath), new DirectoryInfo(TestProjectDirectory));

            File.Copy(Path.Combine(SolutionDirectory, "global.json"), Path.Combine(TestProjectDirectory, "global.json"));
            File.Copy(Path.Combine(ApplicationPath, "..", "Directory.Build.props"), Path.Combine(TestProjectDirectory, "Directory.Build.props"));
            File.Copy(Path.Combine(ApplicationPath, "..", "Directory.Build.targets"), Path.Combine(TestProjectDirectory, "Directory.Build.targets"));

            var deploymentParameters = GetDeploymentParameters();

            if (PublishOnly)
            {
                _deployer = new PublishOnlyDeployer(deploymentParameters, loggerFactory);
            }
            else
            {
                _deployer = ApplicationDeployerFactory.Create(deploymentParameters, loggerFactory);
            }

            return(_deployer.DeployAsync());
        }
        private void EnsureInitialized()
        {
            if (_deployer != null)
            {
                return;
            }

            var deploymentParameters = new IISDeploymentParameters()
            {
                RuntimeArchitecture = RuntimeArchitecture.x64,
                RuntimeFlavor       = RuntimeFlavor.CoreClr,
                TargetFramework     = Tfm.NetCoreApp50,
                HostingModel        = HostingModel.InProcess,
                PublishApplicationBeforeDeployment = true,
                ApplicationPublisher = new PublishedApplicationPublisher(Helpers.GetInProcessTestSitesName()),
                ServerType           = DeployerSelector.ServerType
            };

            _configure(deploymentParameters);

            _deployer         = IISApplicationDeployerFactory.Create(deploymentParameters, _loggerFactory);
            _deploymentResult = (IISDeploymentResult)_deployer.DeployAsync().Result;
        }