我們已將.net framework 3.5,iis 7.0,Windows server 2008 R2遷移到.net framework 3.5,iis 8.5,Windows server 2012 。 AD工作不正常。一旦應用程序池回收,應用程序工作後,它不能正常工作。System.DirectoryServices.DirectorySearcher導致「算術運算導致溢出」錯誤
我收到以下與使用DirectorySearcher.FindOne()或FindAll()查詢AD有關的間歇性錯誤。
System.DirectoryServices.DirectorySearcher造成「算術運算導致溢出」錯誤
System.OverflowException:算術運算導致溢出。 在System.DirectoryServices.SearchResultCollection.ResultsEnumerator.GetCurrentResult() 在System.DirectoryServices.SearchResultCollection.ResultsEnumerator.get_Current() 在System.DirectoryServices.SearchResultCollection.ResultsEnumerator.System.Collections.IEnumerator.get_Current()
感謝您的回覆dmitry。 –
你能解釋我如何使用System.DirectoryServices.Protocols而不是DirectorySearcher.Findone()來實現LdapConnection嗎? –
以下鏈接解釋瞭如何創建一個類似於DirectorySearcher的LDAP搜索器:http://dunnry.com/blog/2008/06/05/PagedAsynchronousLDAPSearchesRevisited.aspx。您可以更改搜索器以在需要時同步工作 – oldovets