If I write this code
protected void Page_Load(object sender, EventArgs e)
{
Page_Load(sender, e);
}
I get the an Error (endless recursion):

and the w3wp.exe process is terminated from task manager.
Fine…
however if i do:
throw new ApplicationException(); //or SystemException();
it appears in just a regular exception page. ( w3wp.exe is still up).
questions :
- what kind of exceptions causing the w3wp.exe to shutdown ?
- what kind of exceptions causing the Application Pool to shutdown ?
p.s.
according to what ive just written , please think about the following scenario :
i can write a web page , host my site in a farm of sites , and i can terminate the whole w3wp.exe process by creating recursion ….. ( also others will have trouble)…
Can you please answer my questions ?
thanks.
This is most likely the famous
StackoverflowException. It’s caused by an infinite loop since you’re calling the methodPage_Loadagain and again.From MSDN:
You may want to have a look at this answer:
https://stackoverflow.com/a/4802309/284240