From 433dd42909d823a10bd2adea005ee630e0a3fdea Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Wed, 8 Aug 2018 17:14:46 -0700 Subject: [PATCH] Use web.config for ASPNETCORE_DETAILEDERRORS --- .../IISDeployer.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS/IISDeployer.cs b/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS/IISDeployer.cs index d76f5f48d7..1030823b3a 100644 --- a/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS/IISDeployer.cs +++ b/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS/IISDeployer.cs @@ -24,6 +24,8 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting.IIS internal const int ERROR_SHARING_VIOLATION = unchecked((int)0x80070020); internal const int ERROR_SERVICE_CANNOT_ACCEPT_CTRL = unchecked((int)0x80070425); + private const string DetailedErrorsEnvironmentVariable = "ASPNETCORE_DETAILEDERRORS"; + private static readonly TimeSpan _timeout = TimeSpan.FromSeconds(10); private static readonly TimeSpan _retryDelay = TimeSpan.FromMilliseconds(200); @@ -71,7 +73,14 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting.IIS // For now, only support using published output DeploymentParameters.PublishApplicationBeforeDeployment = true; + // Move ASPNETCORE_DETAILEDERRORS to web config env variables + if (IISDeploymentParameters.EnvironmentVariables.ContainsKey(DetailedErrorsEnvironmentVariable)) + { + IISDeploymentParameters.WebConfigBasedEnvironmentVariables[DetailedErrorsEnvironmentVariable] = + IISDeploymentParameters.EnvironmentVariables[DetailedErrorsEnvironmentVariable]; + IISDeploymentParameters.EnvironmentVariables.Remove(DetailedErrorsEnvironmentVariable); + } // Do not override settings set on parameters if (!IISDeploymentParameters.HandlerSettings.ContainsKey("debugLevel") && !IISDeploymentParameters.HandlerSettings.ContainsKey("debugFile"))