我的Windows应用程序出现以下错误。异常我无法弄清楚为什么它会来,因为特定的错误不是登录我的异常记录器文件。
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 :(得分:2)
你在ExecuteLogic
中有无限的递归,它不断地调用自己。这最终将使系统脱离堆栈空间。如果您不想离开ExecuteLogic
,只需使用while循环