Stop running an ASP.NET application

In my Application_Start () method, how can I stop the execution of an ASP.NET application when certain conditions are not met?

Throwing an exception does not work.

+3
source share
3 answers

I do not think that's possible; even if you can “interrupt” the start, the next attempt to access the URL from the site will try to start it again

maybe a static variable can be used for the go / no-go signal, and begin_request can redirect to the placeholder page instead?

+2
source

, COM API, IIS. , Environment.Exit().

+1

Do what produces the raw error. Maybe throwing an exception will be enough.

0
source

All Articles