Revert "Make Deployers handle ANCM V1 and V2 (#1407)"

This reverts commit 52802d1afa.
This commit is contained in:
Justin Kotalik 2018-05-02 14:58:53 -07:00
parent 52802d1afa
commit 10a4b84061
3 changed files with 4 additions and 21 deletions

View File

@ -1,11 +0,0 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
namespace Microsoft.AspNetCore.Server.IntegrationTesting
{
public enum ANCMVersion
{
AspNetCoreModule,
AspNetCoreModuleV2
}
}

View File

@ -120,12 +120,6 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting
public HostingModel HostingModel { get; set; } public HostingModel HostingModel { get; set; }
/// <summary>
/// When using the IISExpressDeployer, determines whether to use the older or newer version
/// of ANCM.
/// </summary>
public ANCMVersion ANCMVersion { get; set; } = ANCMVersion.AspNetCoreModule;
/// <summary> /// <summary>
/// Environment variables to be set before starting the host. /// Environment variables to be set before starting the host.
/// Not applicable for IIS Scenarios. /// Not applicable for IIS Scenarios.

View File

@ -106,6 +106,7 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting
// Pass on the applicationhost.config to iis express. With this don't need to pass in the /path /port switches as they are in the applicationHost.config // Pass on the applicationhost.config to iis express. With this don't need to pass in the /path /port switches as they are in the applicationHost.config
// We take a copy of the original specified applicationHost.Config to prevent modifying the one in the repo. // We take a copy of the original specified applicationHost.Config to prevent modifying the one in the repo.
if (serverConfig.Contains("[ANCMPath]")) if (serverConfig.Contains("[ANCMPath]"))
{ {
// We need to pick the bitness based the OS / IIS Express, not the application. // We need to pick the bitness based the OS / IIS Express, not the application.
@ -165,9 +166,8 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting
if (DeploymentParameters.HostingModel == HostingModel.InProcess) if (DeploymentParameters.HostingModel == HostingModel.InProcess)
{ {
ModifyAspNetCoreSectionInWebConfig(key: "hostingModel", value: "inprocess"); ModifyWebConfigToInProcess();
} }
ModifyAspNetCoreSectionInWebConfig(key: "modules", value: DeploymentParameters.ANCMVersion.ToString());
var parameters = string.IsNullOrWhiteSpace(DeploymentParameters.ServerConfigLocation) ? var parameters = string.IsNullOrWhiteSpace(DeploymentParameters.ServerConfigLocation) ?
string.Format("/port:{0} /path:\"{1}\" /trace:error", uri.Port, contentRoot) : string.Format("/port:{0} /path:\"{1}\" /trace:error", uri.Port, contentRoot) :
@ -319,12 +319,12 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting
// Transforms the web.config file to include the hostingModel="inprocess" element // Transforms the web.config file to include the hostingModel="inprocess" element
// and adds the server type = Microsoft.AspNetServer.IIS such that Kestrel isn't added again in ServerTests // and adds the server type = Microsoft.AspNetServer.IIS such that Kestrel isn't added again in ServerTests
private void ModifyAspNetCoreSectionInWebConfig(string key, string value) private void ModifyWebConfigToInProcess()
{ {
var webConfigFile = $"{DeploymentParameters.PublishedApplicationRootPath}/web.config"; var webConfigFile = $"{DeploymentParameters.PublishedApplicationRootPath}/web.config";
var config = XDocument.Load(webConfigFile); var config = XDocument.Load(webConfigFile);
var element = config.Descendants("aspNetCore").FirstOrDefault(); var element = config.Descendants("aspNetCore").FirstOrDefault();
element.SetAttributeValue(key, value); element.SetAttributeValue("hostingModel", "inprocess");
config.Save(webConfigFile); config.Save(webConfigFile);
} }
} }