How can I disable the application?

Our ASP.NET 2 web application handles exceptions very elegantly. We exclude exceptions from Global ASAX in Application_Error. From there, we register an exception, and we show a friendly message to the user.

However, this morning we deployed the latest version of our site. It went fine for half an hour, but then crashed in the App Pool. The site did not return until we restored the previous release.

How can I crash the application pool and skip the normal exception handler? I am trying to reproduce this problem, but so far no luck.




Update : we found a solution. One of our pages was shielding another page. But the URL was configured incorrectly, and the page finished scripting without restrictions, which caused an exception.

+15
application-pool
Jun 15 '10 at 11:40
source share
4 answers

The most common error I've seen and the "pool failure" is a loop call.

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

Just call sMyText ...

+13
Jun 15 '10 at 12:37
source share

To do this, all you have to do is throw any exception (without handling it, of course) from outside the request context.

For example, some exception raised in another thread should do this:

 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.

+12
Jun 15 '10 at 12:13
source share

Aristos's answer is good. I also saw how this was done with a stupid redefinition in the page life cycle when someone changed the override method from OnInit to OnLoad without changing the base call, so it returned to the cycles during the life cycle: i.e.

 protected override void OnLoad(EventArgs e) { //some other most likely rubbish code base.OnInit(e); } 
+5
Jun 15 '10 at 13:15
source share

You can try to throw a ThreadAbortException .

+2
Jun 15 '10 at 11:45
source share



All Articles