jjzjj

StackOverflowException

全部标签

c# - 堆栈展开时嵌套异步方法中的堆栈溢出异常

我们有很多嵌套的异步方法,看到了我们并不真正理解的行为。以这个简单的C#控制台应用程序为例publicclassProgram{staticvoidMain(string[]args){try{varx=Test(index:0,max:int.Parse(args[0]),throwException:bool.Parse(args[1])).GetAwaiter().GetResult();Console.WriteLine(x);}catch(Exceptionex){Console.WriteLine(ex);}Console.ReadKey();}staticasyncTas

c# - 调试由于 StackOverflow 异常而失败的单元测试

每当单元测试由于StackOverflowException而失败时,单元测试过程会立即退出-找出发生了什么(据我所知)的唯一方法是调试单元的故障转储按照此处找到的步骤获得的测试过程CollectingUser-ModeDumps获取在抛出StackOverflowException时正在运行的单元测试的名称的最简单方法是什么?即使在调试单元测试时,我也很难找到当前单元测试的名称,因为它位于堆栈底部,而VisualStudio不会在调试窗口中显示整个堆栈,因为它太大了。有没有办法在不收集和调试故障转储的情况下找出哪个单元测试失败? 最佳答案

c# - System.StackOverflowException ,何时使用 get set 属性?

在wcfserviceLibrary.DLL中发生类型为“System.StackOverflowException”的未处理异常代码如下。[DataContract]publicclassmemberdesignations{[DataMember]publicstringDesigId{get{returnDesigId;}set{DesigId=value;}}[DataMember]publicstringDesignationName{get{returnDesignationName;}set{DesignationName=value;}}}然后我有如下的Typememb

c# - 通过动态引用访问嵌套类的成员时发生 StackOverflowException

我已经定义了一个从BindingList派生的泛型类,并且有一个嵌套的非泛型类:classGeneric:BindingList.Inner>{publicclassInner{publicobjectFoo{get;set;}}}当尝试通过动态引用访问Value属性时,mscorlib中出现StackOverflowException,如下所示:dynamicd=newGeneric.Inner();varvalue=d.Foo;//StackOverflowExceptionvarvalue=d.Bar//StackOverflowExceptionaswell,nota//'Ru

c# - 如何在我的应用程序中找到 StackOverflowException 的来源

我的应用程序中某处出现了StackOverFlow-我正试图找到追踪它的方法。我的事件日志每天都会显示一次崩溃,并包含以下信息:Faultingapplicationname:MyApp.exe,version:1.0.0.0,timestamp:0x522e8317Faultingmodulename:clr.dll,version:4.0.30319.18047,timestamp:0x515530ceExceptioncode:0xc00000fdFaultoffset:0x000000000000c657Faultingprocessid:0x117fcFaultingappl

java - JPA/Hibernate 双向多对一导致 StackOverflowException

我有具有双向一对多关系的实体User和GrantedRole。当我尝试将GrantedRole添加到User中的Set时,没有抛出异常,但是当我调试User和GrantedRole对象的变量时,有一个描述com.sun.jdi.InvocationExceptionoccurredinvokingmethod.变量的不同字段可以在调试时读取,但是当我选择User中的roles字段或GrantedRole中的user字段时,我得到与上面相同的描述。当我进入用户中的GrantedRole集合时,我最终找到了以下描述:Detailformattererror:Anexceptionoccur

c# - Redis .StoreAll 类型为 'System.StackOverflowException' 的未处理异常发生在 mscorlib.dll 中

我正在使用Redis,但StoreAll不起作用。Anunhandledexceptionoftype'System.StackOverflowException'occurredinmscorlib.dllvarnewOrders=(fromiinDB.Produtoes.OrderByDescending(d=>d.idProduto)selecti);using(varprodutosRedis=redisClient.GetTypedClient()){produtosRedis.StoreAll(newOrders);} 最佳答案

c# - AutoMapper 在 IQueryable 上调用 ProjectTo<T>() 时抛出 StackOverflowException

我使用EFCodeFirst创建了具有彼此集合的类。实体:publicclassField{publicintId{get;set;}publicstringName{get;set;}publicvirtualListTeachers{get;set;}publicField(){Teachers=newList();}}publicclassAppUser{publicintId{get;set;}publicstringEmail{get;set;}publicstringPassword{get;set;}publicstringUserName=>Email;publicvi

c# - AutoMapper 在 IQueryable 上调用 ProjectTo<T>() 时抛出 StackOverflowException

我使用EFCodeFirst创建了具有彼此集合的类。实体:publicclassField{publicintId{get;set;}publicstringName{get;set;}publicvirtualListTeachers{get;set;}publicField(){Teachers=newList();}}publicclassAppUser{publicintId{get;set;}publicstringEmail{get;set;}publicstringPassword{get;set;}publicstringUserName=>Email;publicvi

c# - 如何跟踪.NET中StackOverflowException的原因?

运行以下代码时,我得到StackOverflowException:privatevoidMyButton_Click(objectsender,EventArgse){MyButton_Click_Aux();}privatestaticvolatileintreportCount;privatestaticvoidMyButton_Click_Aux(){try{/*removebecausestackoverflowswithout*/}finally{varmyLogData=newArrayList();myLogData.Add(reportCount);myLogData