Merge branch 'release' into dev

This commit is contained in:
Chris R 2016-04-16 23:28:25 -07:00
commit 909be6d307
2 changed files with 17 additions and 13 deletions

View File

@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.Net.Http.Server;
namespace MusicStore namespace MusicStore
{ {
@ -6,14 +7,27 @@ namespace MusicStore
{ {
public static void Main(string[] args) public static void Main(string[] args)
{ {
var host = new WebHostBuilder() var builder = new WebHostBuilder()
// We set the server by name before default args so that command line arguments can override it. // We set the server by name before default args so that command line arguments can override it.
// This is used to allow deployers to choose the server for testing. // This is used to allow deployers to choose the server for testing.
.UseServer("Microsoft.AspNetCore.Server.Kestrel") .UseServer("Microsoft.AspNetCore.Server.Kestrel")
.UseDefaultHostingConfiguration(args) .UseDefaultHostingConfiguration(args)
.UseIISIntegration() .UseIISIntegration()
.UseStartup("MusicStore") .UseStartup("MusicStore");
.Build();
if (string.Equals(builder.GetSetting("server"), "Microsoft.AspNetCore.Server.WebListener", System.StringComparison.Ordinal)
&& string.Equals(builder.GetSetting("environment"), "NtlmAuthentication", System.StringComparison.Ordinal))
{
// Set up NTLM authentication for WebListener like below.
// For IIS and IISExpress: Use inetmgr to setup NTLM authentication on the application vDir or
// modify the applicationHost.config to enable NTLM.
builder.UseWebListener(options =>
{
options.Listener.AuthenticationManager.AuthenticationSchemes = AuthenticationSchemes.NTLM;
});
}
var host = builder.Build();
host.Run(); host.Run();
} }

View File

@ -102,16 +102,6 @@ namespace MusicStore
// request pipeline. // request pipeline.
// Note: Not recommended for production. // Note: Not recommended for production.
app.UseDeveloperExceptionPage(); app.UseDeveloperExceptionPage();
// Set up NTLM authentication for WebListener like below.
// For IIS and IISExpress: Use inetmgr to setup NTLM authentication on the application vDir or
// modify the applicationHost.config to enable NTLM.
var listener = app.ServerFeatures.Get<WebListener>();
if (listener != null)
{
listener.AuthenticationManager.AuthenticationSchemes = AuthenticationSchemes.NTLM;
}
app.UseDatabaseErrorPage(); app.UseDatabaseErrorPage();
// Add the runtime information page that can be used by developers // Add the runtime information page that can be used by developers