asp.net - DirectoryServicesCOMException 80072020 来自在 ApplicationPoolIdentity 下运行的 IIS 7.5 站点

标签 asp.net iis-7.5 directoryservices applicationpoolidentity

我在查找 ASP.NET 4 应用程序在尝试获取给定用户的用户组时失败的问题时遇到了麻烦。与此应用程序关联的应用程序池设置为在 ApplicationPoolIdentity 下运行。

异常信息

System.DirectoryServices.DirectoryServicesCOMException
HRESULT: 80072020
Message: An operations error occurred.
Extended Message: 000004DC: LdapErr: DSID-0C0906E8, comment: In order to perform this operation a successful bind must be completed on the connection., data 0, v1db1

堆栈跟踪

    System.DirectoryServices.DirectoryEntry.Bind(Boolean) 
    System.DirectoryServices.DirectoryEntry.Bind() 
    System.DirectoryServices.DirectoryEntry.get_AdsObject() 
    System.DirectoryServices.DirectorySearcher.FindAll(Boolean) 
    System.DirectoryServices.DirectorySearcher.FindOne() 

在 95%-99% 的情况下,此功能工作正常,但有时会开始失败。当我将应用程序池更改为使用 LocalSystem 或 NetworkService 时,它​​开始工作。当我改回 ApplicationPoolIdentity 时,它再次开始失败。让站点再次使用 ApplicationPoolIdentity 工作的唯一方法是重新启动服务器。

我找到了类似的问题here ,但解决方案也是重新启动。我想找到一个除了更改应用程序池标识之外的更持久的解决方案。

最佳答案

虽然重新启动可以暂时解决该问题,但有一个 Microsoft hotfix KB2545850这提供了问题的永久解决。

关于asp.net - DirectoryServicesCOMException 80072020 来自在 ApplicationPoolIdentity 下运行的 IIS 7.5 站点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13070856/

相关文章:

c# - 无法使用 MVC3 Razor 访问属性

post - IIS7.5 URL 重写 : do not translate POST to GET

c# - 为什么principalsearcher 代码显着变慢

c# - 批量获取AD自定义属性

asp.net - 阻止用户使用 "X"关闭浏览器窗口?

asp.net - Azure 上的自定义 IIS 访问日志记录

.net - 跨负载平衡服务器 (ASP.Net) 的选择性缓存清除

asp.net - MSDeploy.exe 可以以管理员身份连接,但不能以任何其他 Windows 帐户身份连接

file - 使用 HTTP POST 将文件发送到 IIS 7.5 虚拟目录

.net - UserPrincipal 对象中的域名在哪里?