2013-03-21 56 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

相關問題