Stop using IISExpress .config templates (#863)
This commit is contained in:
parent
6bb902e607
commit
670598c05a
File diff suppressed because it is too large
Load Diff
|
|
@ -4,6 +4,7 @@ using System.IO;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.AspNetCore.Server.IntegrationTesting;
|
using Microsoft.AspNetCore.Server.IntegrationTesting;
|
||||||
|
using Microsoft.AspNetCore.Server.IntegrationTesting.IIS;
|
||||||
using Microsoft.AspNetCore.Testing.xunit;
|
using Microsoft.AspNetCore.Testing.xunit;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using Microsoft.Extensions.Logging.Testing;
|
using Microsoft.Extensions.Logging.Testing;
|
||||||
|
|
@ -36,8 +37,6 @@ namespace E2ETests
|
||||||
ApplicationPath = Helpers.GetApplicationPath(),
|
ApplicationPath = Helpers.GetApplicationPath(),
|
||||||
PreservePublishedApplicationForDebugging = Helpers.PreservePublishedApplicationForDebugging,
|
PreservePublishedApplicationForDebugging = Helpers.PreservePublishedApplicationForDebugging,
|
||||||
EnvironmentName = "NtlmAuthentication", //Will pick the Start class named 'StartupNtlmAuthentication'
|
EnvironmentName = "NtlmAuthentication", //Will pick the Start class named 'StartupNtlmAuthentication'
|
||||||
ServerConfigTemplateContent = Helpers.GetConfigContent(variant.Server, "NtlmAuthentation.config"),
|
|
||||||
SiteName = "MusicStoreNtlmAuthentication", //This is configured in the NtlmAuthentication.config
|
|
||||||
UserAdditionalCleanup = parameters =>
|
UserAdditionalCleanup = parameters =>
|
||||||
{
|
{
|
||||||
DbUtils.DropDatabase(musicStoreDbName, logger);
|
DbUtils.DropDatabase(musicStoreDbName, logger);
|
||||||
|
|
@ -50,6 +49,25 @@ namespace E2ETests
|
||||||
MusicStoreConfig.ConnectionStringKey,
|
MusicStoreConfig.ConnectionStringKey,
|
||||||
DbUtils.CreateConnectionString(musicStoreDbName)));
|
DbUtils.CreateConnectionString(musicStoreDbName)));
|
||||||
|
|
||||||
|
if (variant.Server == ServerType.IISExpress)
|
||||||
|
{
|
||||||
|
var iisDeploymentParameters = new IISDeploymentParameters(deploymentParameters);
|
||||||
|
iisDeploymentParameters.ServerConfigActionList.Add(
|
||||||
|
(element, _) => {
|
||||||
|
var authentication = element
|
||||||
|
.RequiredElement("system.webServer")
|
||||||
|
.GetOrAdd("security")
|
||||||
|
.GetOrAdd("authentication");
|
||||||
|
|
||||||
|
authentication.GetOrAdd("anonymousAuthentication")
|
||||||
|
.SetAttributeValue("enabled", "false");
|
||||||
|
|
||||||
|
authentication.GetOrAdd("windowsAuthentication")
|
||||||
|
.SetAttributeValue("enabled", "true");
|
||||||
|
});
|
||||||
|
deploymentParameters = iisDeploymentParameters;
|
||||||
|
}
|
||||||
|
|
||||||
using (var deployer = IISApplicationDeployerFactory.Create(deploymentParameters, loggerFactory))
|
using (var deployer = IISApplicationDeployerFactory.Create(deploymentParameters, loggerFactory))
|
||||||
{
|
{
|
||||||
var deploymentResult = await deployer.DeployAsync();
|
var deploymentResult = await deployer.DeployAsync();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue