ASP.NET MVC6 Beta8 and Windows Authentication

After upgrading to Beta 8, debugging using Windows authentication does not work in IIS Express. I get an error

"An error occurred while trying to determine the process ID of the DNX process on which your application is hosted."

Playback steps :.

  • Create a new project and select Blank Web Template.
  • In the project settings, change the IIS Express settings to use Windows authentication. Uncheck anonymous authentication.
  • Enable SSL.
  • Debug a project.
  • Error.

I am using a new installation of Windows and Visual Studio. Do I need to download any additional software besides the installation files ?

+6
source share
1 answer

As noted in the comments, there is a problem of an open instrumental error for this error . At the same time, I was able to successfully debug using WebListener, which needs the following two changes:

In Startup.cs

 using Microsoft.AspNet.Http.Features; using Microsoft.Net.Http.Server; 

and in the Configure method add:

 var listener = app.ServerFeatures.Get<WebListener>(); if (listener != null) { listener.AuthenticationManager.AuthenticationSchemes = AuthenticationSchemes.NTLM; } 

In project.json add a new weblistener command as follows:

 "commands": { "weblistener": "Microsoft.AspNet.Server.WebListener --config hosting.ini", "web": "Microsoft.AspNet.Server.Kestrel" }, 

and make sure you have a WebListener in the dependencies section

 "Microsoft.AspNet.Server.WebListener": "1.0.0-beta8", 

Since I was upgrading from beta 7, I had to change the host.ini file in json format - I don’t know if it is important or not!

Once this is done, you can debug using the weblistener instead of IIS Express. Using web (i.e. Kestrel) for debugging does not work, because Kestrel does not (and will not) support NTLM authentication.

I found that if I changed the "web" command directly in project.json, Visual Studio would help to correct it back to kestrel quite aggressively, so adding a separate command as recommended by the Microsoft team seems to be all right.

+3
source

All Articles