2013-03-21 54 views
1

我从我的Windows应用程序中收到错误。异常我无法弄清楚为什么它会来,因为特定的错误是不是登录在我的例外记录器文件。我怎么弄出KERNELBASE.dll错误?

 
Application name has failed: Test.exe, Version:1.0.0.15, time stamp: 0x51481394 
Failing module name: KERNELBASE.dll, version:6.1.7601.18015, time stamp: 0x50b83b16 
exception code :0xe053534f 
fault offset :0x0000812f 
Process ID has failed:0x% 9 
the start time of the applications are failing:0x% 10 
Application path has failed :% 11 
module path has failed :% 12 
Report ID:% 13 

请找到下面的代码

private void frmSetTime_Load(object sender, EventArgs e) 
{ 
    try 
    { 
     string[] cmds = System.Environment.GetCommandLineArgs(); 
     //Here i gets Command Line Arguments 
    } 
    catch (Exception ex) 
    { 
     MessageBox.show(ex.message); 
    } 
    finally 
    { 
     GC.Collect(); 
    } 
} 

public void ExecuteLogic(Object obj) 
{ 
    try 
    { 
     //My set of Statements 
     Therad.sleep(5000); 
     ExecuteLogic(obj); 
    } 
    catch (Exception ex) 
    { 
     MessageBox.show(ex.message); 
    } 
    finally 
    { 
     GC.Collect(); 
     ApplicationRestart(); 
    } 
} 

private void ApplicationRestart() 
{ 
    try 
    { 
     if (Process.GetCurrentProcess().WorkingSet64 >= 10000000) 
     {       
      Application.Restart();      
     } 
    } 
    catch (Exception ex) 
    { 
     MessageBox.Show(ex.message); 
    } 
} 
+0

向我们显示重现错误的代码? – 2013-03-21 02:11:31

+0

@Jeremy Thompson请在上面找到代码。 – 2013-03-21 02:41:23

+0

@RamdasBhosale搜索异常代码“0xe053534f”表明它是由于堆栈溢出导致的:http://stackoverflow.com/a/3406058/161455 – shf301 2013-03-21 02:54:20

回答

2

你有无限递归在ExecuteLogic它不断地调用自身。这将最终运行系统堆栈空间。如果您不想离开ExecuteLogic只需使用一个while循环

+0

我使用C#中的递归从CRM构建菜单。刚刚遇到了同样的问题。那么一个while循环代替Lambda表达式更好用吗? – TheLegendaryCopyCoder 2016-01-11 12:36:22

相关问题