Visual Studio 2015 vNext和Windows身份验证

Out*_*per 6 c# asp.net iis windows-authentication visual-studio-2015

如何配置项目以使用Windows身份验证?既然没有web.config文件,我看不出怎么做.

我在Startup中看到app.UseIdentity(),但不知道如何在IIS Express中使用Windows Auth.当我尝试在IIS(Windows 7,IIS 7.5)中创建项目时,似乎没有.NET 4.6/4.5应用程序池我尝试使用.NET 4.0但出现错误:

无法确定要运行的适当版本的运行时.有关详细信息,请参阅http://go.microsoft.com/fwlink/?LinkId=517742.

当然,这个链接并没有带给我信息,但是http://www.asp.net/

Pau*_*aul 6

在使用VS2015进行调试时,对我有用的是:

打开IIS Express配置文件: %userprofile%\Documents\IISExpress\config\applicationhost.config

有一条线说:
<windowsAuthentication enabled="false">

将其更改为:
<windowsAuthentication enabled="true">

然后我添加到我的Web.conf:

<authentication mode="Windows">
</authentication>
<authorization>
</authorization>
Run Code Online (Sandbox Code Playgroud)

然后,我可以使用以下命令拉出Windows用户名:
Request.LogonUserIdentity.Name


Jac*_*cee -2

IISExpress 也有一个配置文件。请参阅此处的指南:请参阅通过 IISExpress 使用 Windows 身份验证