C# IIS 抱怨使用 LDAP 身份验证进行身份模拟

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13804636/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-10 09:51:03  来源:igfitidea点击:

IIS complaining about Identity Impersonation using LDAP Authentication

c#asp.netauthentication.net-4.0ldap

提问by Jerry Dodge

I followed a tutorial to implement LDAP authentication in an ASP.NET/C# 4.0 web application. I did so in Visual Studio 2010. The site runs fine in debug mode through Visual Studio, but when I publish this site in IIS7, it is failing with the following error:

我按照教程在 ASP.NET/C# 4.0 Web 应用程序中实现 LDAP 身份验证。我在 Visual Studio 2010 中这样做了。该站点通过 Visual Studio 在调试模式下运行良好,但是当我在 IIS7 中发布此站点时,它失败并出现以下错误:

HTTP Error 500.24 - Internal Server Error An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode.

Most likely causes:

  • system.web/identity@impersonate is set to true.

HTTP 错误 500.24 - 内部服务器错误 检测到不适用于集成托管管道模式的 ASP.NET 设置。

最可能的原因:

  • system.web/identity@impersonate 设置为 true。

In fact, part of the tutorial required that I add this to the config file...

事实上,本教程的一部分要求我将其添加到配置文件中...

<identity impersonate="true"/>

So why would I be getting this error and how do I fix it?

那么为什么我会收到这个错误,我该如何解决呢?

采纳答案by Darren Wainwright

Try changing your application pool's pipeline mode to 'Classic'

尝试将应用程序池的管道模式更改为“经典”

You do this by opening IIS -> Application Pools -> Right-click your application pool and select Basic Settings -> Managed pipline mode, change to Classic

您可以通过打开 IIS -> 应用程序池 -> 右键单击​​您的应用程序池并选择基本设置 -> 托管管道模式,更改为 Classic

Restart your app pool and site (shouldn't need to but never hurts to try) and try again.

重新启动您的应用程序池和站点(不需要但尝试不会有任何伤害),然后再试一次。

Another thing you can try, instead of the above, is to put the following in your web.configfile, inside the <system.webServer>node:

您可以尝试的另一件事是将以下内容放入您的web.config文件中的<system.webServer>节点内:

       <validation validateIntegratedModeConfiguration="false" />