Windows身份验证在IIS Express中不起作用,使用Visual Studio 2013,Windows 8进行调试

编程入门 行业动态 更新时间:2024-10-26 10:33:59
本文介绍了Windows身份验证在IIS Express中不起作用,使用Visual Studio 2013,Windows 8进行调试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我刚刚将我的应用程序从Visual Studio 2012升级到了Visual Studio2013.我的Windows身份验证不再起作用.它给了我下面的错误.

I just upgraded my application from Visual studio 2012 to Visual studio 2013. My windows authentication is not working any more. It is giving me below error.

HTTP Error 401.2 - Unauthorized You are not authorized to view this page due to invalid authentication headers.

在Visual Studio中,可以从网站属性本身中选择身份验证.因此,我禁用了匿名访问并启用了Windows身份验证,但它要求我提供用户名和密码,如下所示.即使我在这里提供域凭据.它仍然一次又一次地给我这个弹出窗口.

In visual studio there is option to select authentication from website properties itself. So I disabled anonymous access and enable windows authentication but it is asking me for username and password as below popup. Even if I give domain credentials here. Its is still giving me this popup again and again.

Web配置:

<authentication mode="Windows" /> <authorization> <deny users="?" /> </authorization> <identity impersonate="false" /> <trace enabled="true" />

IIS Express aspnetConfig:

<authentication> <anonymousAuthentication enabled="false" userName="" /> <basicAuthentication enabled="false" /> <clientCertificateMappingAuthentication enabled="false" /> <digestAuthentication enabled="false" /> <iisClientCertificateMappingAuthentication enabled="false"> </iisClientCertificateMappingAuthentication> <windowsAuthentication enabled="true"> <providers> <add value="Negotiate" /> <add value="NTLM" /> </providers> </windowsAuthentication> </authentication> <authorization> <add accessType="Allow" users="*" /> </authorization> <location path="Path"> <system.webServer> <security> <authentication> <windowsAuthentication enabled="true" /> <anonymousAuthentication enabled="false" /> </authentication> </security> </system.webServer> </location>

如果您需要更多详细信息,请告诉我.

Let me know if you want more details on this.

更新:

我发现,如果我从web.config中删除以下行,它将开始工作.

I found out that if I remove below line from web.config than it start working.

<remove users="*" roles="" verbs="" />

推荐答案

请注意applicationhost.config的修改-在Visual Studio 2015中,我发现有时驻留在本地项目目录中

Be careful with the applicationhost.config modifications - in Visual Studio 2015 I've found that it sometimes resides in the local project directory.

例如:

DRIVE:\MYPROJECT\.vs\config\applicationhost.config

如果您不确定正在使用哪个applicationhost配置文件,则可以使用ProcMon& Monitor监视文件访问.然后根据路径"缩小结果范围,以查看VS在调试时实际读取的内容.

If you're not sure which applicationhost config file is being used, you can monitor file access with ProcMon & then narrow down the results based on "Path" to see what VS is actually reading at Debug time.

更新:这似乎也是Visual Studio 2017中的行为.

Update: This appears to be the behavior in Visual Studio 2017 as well.

更多推荐

Windows身份验证在IIS Express中不起作用,使用Visual Studio 2013,Windows 8进行调试

本文发布于:2023-11-05 04:42:41,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1559933.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:中不   身份验证   IIS   Windows   Express

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!