来自字符串的getHashCode函数的堆栈溢出异常 [英] Stack overflow exception coming from getHashCode function for string
本文介绍了来自字符串的getHashCode函数的堆栈溢出异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我尝试访问System.Configuration.ConfigurationManager.AppSettings.Get(Key)时,我从函数GetHashCodeOfString引发了堆栈溢出异常.堆栈让我觉得它正在尝试设置哈希并对其进行排序,这是在哪里 发生异常.仅当我在Web应用程序上运行多个选项卡(同时都调用此选项卡)时,才会发生此异常.
在调用appsettings.get
之后,总体堆栈跟踪基本上如下.NameValueCollection.Get
NameObjectCOllectionBase.FindEntry
Hashtable.this.get
HashTable.InitHash
CultureAwareComparer.GetHashCode
CompareInfo.GetHashCodeOfString
管理到本地过渡
解决方案
您好 解决方案
Hi Bluedot55
I wonder if you use recursion in your code. Because recursion often causes dead lock usually.
For example, here are two important points about Static variables
- Static variables provide global access, can retain values between subprogram invocations (history sensitive), and are efficient.
- Static variables do not support recursion
Best regards,
Kristin
这篇关于来自字符串的getHashCode函数的堆栈溢出异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文