asp.net-mvc – 所有请求获取HTTP错误401.2 – 未经授权的响应

我的MVC应用程序,直到几分钟前,一直工作正常(作为解决方案的一部分,作为asp / net成员).但是,无需明知地更改任何与每个请求相关的任何内容,甚至不需要任何授权属性等等.

我已经把所有的条目从web.config中取出,现在与授权有关,我已经检查了applicationhost.config,它具有以下内容:

<access sslFlags="None" />

        <applicationDependencies>
            <application name="Active Server Pages" groupId="ASP" />
        </applicationDependencies>

        <authentication>

            <anonymousAuthentication enabled="true" userName="" />

            <basicAuthentication enabled="false" />

            <clientCertificateMappingAuthentication enabled="false" />

            <digestAuthentication enabled="false" />

            <iisClientCertificateMappingAuthentication enabled="false">
            </iisClientCertificateMappingAuthentication>

            <windowsAuthentication enabled="false">
                <providers>
                    <add value="Negotiate" />
                    <add value="NTLM" />
                </providers>
            </windowsAuthentication>

        </authentication>

        <authorization>
            <add accessType="Allow" users="*" />
        </authorization>

任何人都可以建议可能导致这种情况吗?

谢谢

关于这一点的更多信息,我切换到使用完整的IIS,它的工作正常,所以它看起来像一个IIS Express问题.任何关于事业的线索?是否没有完整的IIS express gui除了系统托盘图标?

解决方法

选项1:

在applicationhost.config中检查是否有任何条目,如下所示.如果有任何这样的条目将anonymousAuthetication启用值从“false”更改为“true”.

<location path="YOUR-APPLICATION-NAME">
    <system.webServer>
        <security>
            <authentication>
                <anonymousAuthentication enabled="false" />
            </authentication>
        </security>
    </system.webServer>
</location>

选项2:

如果您正在使用visual studio,请确保已启用anonymousAuthentication.

dawei

【声明】:唐山站长网内容转载自互联网,其相关言论仅代表作者个人观点绝非权威,不代表本站立场。如您发现内容存在版权问题,请提交相关链接至邮箱:bqsm@foxmail.com,我们将及时予以处理。