Use fallback
This commit is contained in:
parent
a0f236759d
commit
7a51de05d6
|
|
@ -1,6 +1,7 @@
|
||||||
// Copyright (c) .NET Foundation. All rights reserved.
|
// 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.
|
// 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.AspNetCore.Hosting;
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
using Microsoft.Net.Http.Server;
|
using Microsoft.Net.Http.Server;
|
||||||
|
|
@ -13,7 +14,6 @@ namespace ServerComparison.TestSites.Standalone
|
||||||
{
|
{
|
||||||
var config = new ConfigurationBuilder()
|
var config = new ConfigurationBuilder()
|
||||||
.AddCommandLine(args)
|
.AddCommandLine(args)
|
||||||
.AddEnvironmentVariables(prefix: "ASPNETCORE_")
|
|
||||||
.Build();
|
.Build();
|
||||||
|
|
||||||
var builder = new WebHostBuilder()
|
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.
|
// 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("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.
|
// Set up NTLM authentication for WebListener as follows.
|
||||||
// For IIS and IISExpress use inetmgr to setup NTLM authentication on the application or
|
// For IIS and IISExpress use inetmgr to setup NTLM authentication on the application or
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
using Microsoft.AspNetCore.Hosting;
|
using Microsoft.AspNetCore.Hosting;
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
using Microsoft.Net.Http.Server;
|
using Microsoft.Net.Http.Server;
|
||||||
|
using System;
|
||||||
|
|
||||||
namespace ServerComparison.TestSites
|
namespace ServerComparison.TestSites
|
||||||
{
|
{
|
||||||
|
|
@ -13,9 +14,8 @@ namespace ServerComparison.TestSites
|
||||||
{
|
{
|
||||||
var config = new ConfigurationBuilder()
|
var config = new ConfigurationBuilder()
|
||||||
.AddCommandLine(args)
|
.AddCommandLine(args)
|
||||||
.AddEnvironmentVariables(prefix: "ASPNETCORE_")
|
|
||||||
.Build();
|
.Build();
|
||||||
|
|
||||||
var builder = new WebHostBuilder()
|
var builder = new WebHostBuilder()
|
||||||
.UseConfiguration(config)
|
.UseConfiguration(config)
|
||||||
.UseIISIntegration()
|
.UseIISIntegration()
|
||||||
|
|
@ -24,7 +24,9 @@ namespace ServerComparison.TestSites
|
||||||
// Switch beteween Kestrel and WebListener for different tests. Default to Kestrel for normal app execution.
|
// 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("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.
|
// Set up NTLM authentication for WebListener as follows.
|
||||||
// For IIS and IISExpress use inetmgr to setup NTLM authentication on the application or
|
// For IIS and IISExpress use inetmgr to setup NTLM authentication on the application or
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue