System.Directoryservices.DirectorySearcher引起算术运算导致溢出错误 [英] System.Directoryservices.DirectorySearcher causing Arithmetic operation resulted in overflow errors

查看:930
本文介绍了System.Directoryservices.DirectorySearcher引起算术运算导致溢出错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到有关使用查询AD下面的间歇性错误 DirecotrySearcher.FindOne()的FindAll()。

I'm getting the following intermittent errors related to querying AD using DirecotrySearcher.FindOne() or FindAll().

System.OverflowException: Arithmetic operation resulted in an overflow.
     at System.DirectoryServices.SearchResultCollection.ResultsEnumerator.GetCurrentResult()
     at System.DirectoryServices.SearchResultCollection.ResultsEnumerator.get_Current()
     at System.DirectoryServices.SearchResultCollection.ResultsEnumerator.System.Collections.IEnumerator.get_Current()

这是发生在一个Web应用程序,并似乎发生后,该应用程序已经运行了几个小时。

This is happening in a web app and seems to happen after the app has been running for several hours.

这是一个<一个href="http://connect.microsoft.com/VisualStudio/feedback/details/681135/system-directoryservices-arithmetic"相对=微软nofollow的>记载的问题连接,但它看起来像它已被标记为未repoducible,并关闭了。

This is a documented issue on microsoft connect but it looks like it has been marked as "not repoducible" and closed out.

这是我发现这里唯一的解决是定期回收应用程序池这是一个相当苛刻的解决方法,而不是可行的,当你的用户是在工作的中间。

The only fix that I found here is to recycle the app pool periodically which is a rather harsh workaround and not viable when your users are in the middle of working.

有没有人经历了这一点,如果让这怎么解决?

Has anyone experienced this and if so how was this resolved?

我曾尝试使用缓存,但这只是推迟了不可避免的,直到公元的数量方面创下了一定的门槛,因为来电人反映,每次API调用是由它的leaks内存

I have tried to use caching but this just delays the inevitable until you hit a certain threshold in terms of the number of AD calls since people have reported that each time the API call is made it leaks memory

任何帮助将是非常美联社preciated。

Any help would be much appreciated.

http://forums.asp.net/t/1673012.aspx/1

<一个href="http://connect.microsoft.com/VisualStudio/feedback/details/681135/system-directoryservices-arithmetic" rel="nofollow">http://connect.microsoft.com/VisualStudio/feedback/details/681135/system-directoryservices-arithmetic

推荐答案

建立一个AD API,并在它自己的应用程序池运行它。再循环,每几个小时。所有的API将处理为呼叫广告。看起来你已经拥有了code,只需要移动到API。我已经找到了AD的API是许多其他项目非常有用,并保存回去把它作为参考点。

Build an AD API and run it in it's own app pool. The recycle that every few hours. All the API will handle is calls to AD. looks like you already have the code, just need to move to API. I have found a AD API to be very useful for lots of other projects as well and keep going back to it as reference point.

这篇关于System.Directoryservices.DirectorySearcher引起算术运算导致溢出错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆