Use fallback

This commit is contained in:
BrennanConroy 2016-04-28 12:33:25 -07:00
parent a0f236759d
commit 7a51de05d6
2 changed files with 9 additions and 5 deletions

View File

@ -1,6 +1,7 @@
// 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.
using System;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Net.Http.Server;
@ -13,7 +14,6 @@ namespace ServerComparison.TestSites.Standalone
{
var config = new ConfigurationBuilder()
.AddCommandLine(args)
.AddEnvironmentVariables(prefix: "ASPNETCORE_")
.Build();
var builder = new WebHostBuilder()
@ -24,7 +24,9 @@ namespace ServerComparison.TestSites.Standalone
// Switch beteween Kestrel and WebListener for different tests. Default to Kestrel for normal app execution.
if (string.Equals(builder.GetSetting("server"), "Microsoft.AspNetCore.Server.WebListener", System.StringComparison.Ordinal))
{
if (string.Equals(builder.GetSetting("environment"), "NtlmAuthentication", System.StringComparison.Ordinal))
if (string.Equals(builder.GetSetting("environment") ??
Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT"),
"NtlmAuthentication", System.StringComparison.Ordinal))
{
// Set up NTLM authentication for WebListener as follows.
// For IIS and IISExpress use inetmgr to setup NTLM authentication on the application or

View File

@ -4,6 +4,7 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Net.Http.Server;
using System;
namespace ServerComparison.TestSites
{
@ -13,9 +14,8 @@ namespace ServerComparison.TestSites
{
var config = new ConfigurationBuilder()
.AddCommandLine(args)
.AddEnvironmentVariables(prefix: "ASPNETCORE_")
.Build();
var builder = new WebHostBuilder()
.UseConfiguration(config)
.UseIISIntegration()
@ -24,7 +24,9 @@ namespace ServerComparison.TestSites
// Switch beteween Kestrel and WebListener for different tests. Default to Kestrel for normal app execution.
if (string.Equals(builder.GetSetting("server"), "Microsoft.AspNetCore.Server.WebListener", System.StringComparison.Ordinal))
{
if (string.Equals(builder.GetSetting("environment"), "NtlmAuthentication", System.StringComparison.Ordinal))
if (string.Equals(builder.GetSetting("environment") ??
Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT"),
"NtlmAuthentication", System.StringComparison.Ordinal))
{
// Set up NTLM authentication for WebListener as follows.
// For IIS and IISExpress use inetmgr to setup NTLM authentication on the application or