我有困难找到一个问题,即ASP.NET 4应用程序有时在尝试为给定用户获取用户组时失败。与此应用程序关联的应用程序池设置为在ApplicationPoolIdentity下运行。
异常信息
95%-99%的时间,此函数都能正常工作,但偶尔会出现失败情况。当我将应用程序池更改为LocalSystem或NetworkService时,它开始工作。当我更改回ApplicationPoolIdentity时,它又开始失败了。唯一使网站与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再次工作的方法是重新启动服务器。
我找到了一个类似的问题在这里,但解决方案也是重新启动。我希望找到一个更持久的解决方案而不必更改应用程序池的标识。