Triynko
Triynko

Reputation: 19204

How to get Application_End to run while debugging (or when stopping debugging)?

I want to handle application shutdown gracefully when stopping debugging or stopping the IIS Express web site, but I cannot seem to get Application_End to run.

Upvotes: 7

Views: 1702

Answers (2)

k3davis
k3davis

Reputation: 1105

If you're debugging using IIS Express, the Application_End function will execute if you right-click on the IIS Express icon on the tray, select the proper site from the context menu and stop it. This will end your debugging session in a way that does execute the Application_End method.

Upvotes: 13

Kaveh Hadjari
Kaveh Hadjari

Reputation: 237

Try to make a change in web.config and save.

Upvotes: 1

Related Questions