Home > OS >  Correct way to stop an ASP.net application during configuration?
Correct way to stop an ASP.net application during configuration?

Time:01-17

I have an ASP.net Core 6 web application that uses the classic Startup class to bootstrap and configure the app.

In the .Configure() method of the startup class I need to check for a certain condition and if it doesn't pass I need to terminate the application.

My question is: is there a "proper" way to do this? Should I just throw an exception, or is there a more elegant/graceful way?

CodePudding user response:

I'm gonna assume throwing an exception is the correct approach, since nobody provided any alternative.

  • Related