React to IApplicationBuilder.Server change.

This commit is contained in:
Chris R 2015-09-02 08:28:36 -07:00
parent 6d26d5efd7
commit 2255f3f7ad
1 changed files with 4 additions and 4 deletions

View File

@ -4,7 +4,7 @@ using Microsoft.AspNet.Authorization;
using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Diagnostics;
using Microsoft.AspNet.Diagnostics.Entity;
using Microsoft.AspNet.Server.WebListener;
using Microsoft.AspNet.Http.Features;
using Microsoft.Data.Entity;
using Microsoft.Framework.Caching.Memory;
using Microsoft.Framework.Configuration;
@ -94,10 +94,10 @@ namespace MusicStore
// 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.
if ((app.Server as ServerInformation) != null)
var listener = app.ServerFeatures.Get<WebListener>();
if (listener != null)
{
var serverInformation = (ServerInformation)app.Server;
serverInformation.Listener.AuthenticationManager.AuthenticationSchemes = AuthenticationSchemes.NTLM;
listener.AuthenticationManager.AuthenticationSchemes = AuthenticationSchemes.NTLM;
}
app.UseDatabaseErrorPage(DatabaseErrorPageOptions.ShowAll);