我在查找 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/