How do I crash the App Pool? How do I crash the App Pool? asp.net asp.net

How do I crash the App Pool?


The most common error that I have see and "pool crash" is the loop call.

public string sMyText{   get {return sMyText;}   set {sMyText = value;}} 

Just call the sMyText...


In order to do this, all you need to do is throw any exception (without handling it of course) from outside the context of a request.

For instance, some exception raised on another thread should do it:

protected void Page_Load(object sender, EventArgs e){   // Create a thread to throw an exception   var thread = new Thread(() => { throw new ArgumentException(); });   // Start the thread to throw the exception   thread.Start();   // Wait a short while to give the thread time to start and throw   Thread.Sleep(50);}

More information can be found here in the MS Knowledge Base


Aristos' answer is good. I've also seen it done with a stupid override in the Page life cycle too when someone change the overriden method from OnInit to OnLoad without changing the base call so it recursed round in cirlces through the life cycle: i.e.

protected override void OnLoad(EventArgs e){  //some other most likely rubbish code  base.OnInit(e);}